X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=fs%2Fbtrfs%2Finode.c;h=6862cd7e21a996badf559082318a7163f6be912e;hb=0669704270e142483d80cfda5c526426c1a89711;hp=43c803c16b4824d695f84c8fca0b1835ecc82511;hpb=6a343656d30229a424458f8111e55df336375382;p=platform%2Fkernel%2Flinux-starfive.git diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 43c803c..6862cd7 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8123,20 +8123,17 @@ again: /* * Qgroup reserved space handler * Page here will be either - * 1) Already written to disk - * In this case, its reserved space is released from data rsv map - * and will be freed by delayed_ref handler finally. - * So even we call qgroup_free_data(), it won't decrease reserved - * space. - * 2) Not written to disk - * This means the reserved space should be freed here. However, - * if a truncate invalidates the page (by clearing PageDirty) - * and the page is accounted for while allocating extent - * in btrfs_check_data_free_space() we let delayed_ref to - * free the entire extent. + * 1) Already written to disk or ordered extent already submitted + * Then its QGROUP_RESERVED bit in io_tree is already cleaned. + * Qgroup will be handled by its qgroup_record then. + * btrfs_qgroup_free_data() call will do nothing here. + * + * 2) Not written to disk yet + * Then btrfs_qgroup_free_data() call will clear the QGROUP_RESERVED + * bit of its io_tree, and free the qgroup reserved data space. + * Since the IO will never happen for this page. */ - if (PageDirty(page)) - btrfs_qgroup_free_data(inode, NULL, page_start, PAGE_SIZE); + btrfs_qgroup_free_data(inode, NULL, page_start, PAGE_SIZE); if (!inode_evicting) { clear_extent_bit(tree, page_start, page_end, EXTENT_LOCKED | EXTENT_DELALLOC | EXTENT_DELALLOC_NEW |