Hi Chris, Here are some bug-fixes and cleanups, you can pull it from git://github.com/liubogithub/btrfs-work.git for-chris There are two patches for setflags/getflags, in which we did not set compress flags properly. And four patches focus on error handling side. Besides, three trival cleanups and an update for MAINTAINERS are also included. I''ve run through xfstests and everything looks good. Liu Bo (9): Btrfs: remove unused FS_NOCOMP_FL check in setflags and getflags Btrfs: fix missing inherited flag in rename Btrfs: do not resize a seeding device Btrfs: avoid memory leak of extent state in error handling routine Btrfs: make sure that we''ve made everything in pinned tree clean Btrfs: fix typo in btrfs_finish_ordered_io Btrfs: fix typo in cow_file_range_async Btrfs: update MAINTAINERS info for BTRFS FILE SYSTEM Btrfs: use wrapper page_offset Miao Xie (1): Btrfs: destroy the items of the delayed inodes in error handling routine MAINTAINERS | 4 ++-- fs/btrfs/delayed-inode.c | 18 ++++++++++++++++++ fs/btrfs/delayed-inode.h | 3 +++ fs/btrfs/disk-io.c | 21 ++++++++++++++++++++- fs/btrfs/extent_io.c | 20 ++++++++++---------- fs/btrfs/inode.c | 17 ++++++++++------- fs/btrfs/ioctl.c | 24 +++++++++++------------- fs/btrfs/relocation.c | 2 +- 8 files changed, 75 insertions(+), 34 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Liu Bo
2012-Jun-14 08:23 UTC
[PATCH 01/10] Btrfs: remove unused FS_NOCOMP_FL check in setflags and getflags
chattr only uses FS_COMPR_FL to switch on/off the compression flag, so we don''t need these FS_NOCOMP_FL checks. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> --- fs/btrfs/ioctl.c | 17 ++++------------- 1 files changed, 4 insertions(+), 13 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 24b776c..57380ee 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -85,11 +85,9 @@ static unsigned int btrfs_flags_to_ioctl(unsigned int flags) iflags |= FS_DIRSYNC_FL; if (flags & BTRFS_INODE_NODATACOW) iflags |= FS_NOCOW_FL; - - if ((flags & BTRFS_INODE_COMPRESS) && !(flags & BTRFS_INODE_NOCOMPRESS)) + if ((flags & BTRFS_INODE_COMPRESS) && + !(flags & BTRFS_INODE_NOCOMPRESS)) iflags |= FS_COMPR_FL; - else if (flags & BTRFS_INODE_NOCOMPRESS) - iflags |= FS_NOCOMP_FL; return iflags; } @@ -158,13 +156,9 @@ static int check_flags(unsigned int flags) if (flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | \ FS_NOATIME_FL | FS_NODUMP_FL | \ FS_SYNC_FL | FS_DIRSYNC_FL | \ - FS_NOCOMP_FL | FS_COMPR_FL | - FS_NOCOW_FL)) + FS_COMPR_FL | FS_NOCOW_FL)) return -EOPNOTSUPP; - if ((flags & FS_NOCOMP_FL) && (flags & FS_COMPR_FL)) - return -EINVAL; - return 0; } @@ -244,10 +238,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) * flag may be changed automatically if compression code won''t make * things smaller. */ - if (flags & FS_NOCOMP_FL) { - ip->flags &= ~BTRFS_INODE_COMPRESS; - ip->flags |= BTRFS_INODE_NOCOMPRESS; - } else if (flags & FS_COMPR_FL) { + if (flags & FS_COMPR_FL) { ip->flags |= BTRFS_INODE_COMPRESS; ip->flags &= ~BTRFS_INODE_NOCOMPRESS; } else { -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
When we move a file into a directory with compression flag, we need to inherite BTRFS_INODE_COMPRESS and clear BTRFS_INODE_NOCOMPRESS as well. But if we move a file into a directory without compression flag, we need to clear both of them. It is the way how our setflags deals with compression flag, so keep the same behaviour here. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> --- fs/btrfs/inode.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 92df0a5..bc66330 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7082,10 +7082,13 @@ static void fixup_inode_flags(struct inode *dir, struct inode *inode) else b_inode->flags &= ~BTRFS_INODE_NODATACOW; - if (b_dir->flags & BTRFS_INODE_COMPRESS) + if (b_dir->flags & BTRFS_INODE_COMPRESS) { b_inode->flags |= BTRFS_INODE_COMPRESS; - else - b_inode->flags &= ~BTRFS_INODE_COMPRESS; + b_inode->flags &= ~BTRFS_INODE_NOCOMPRESS; + } else { + b_inode->flags &= ~(BTRFS_INODE_COMPRESS | + BTRFS_INODE_NOCOMPRESS); + } } static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Seeding devices are not supposed to change any more. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> --- fs/btrfs/ioctl.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 57380ee..5ff79fd 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1295,6 +1295,13 @@ static noinline int btrfs_ioctl_resize(struct btrfs_root *root, ret = -EINVAL; goto out_free; } + if (device->fs_devices && device->fs_devices->seeding) { + printk(KERN_INFO "btrfs: resizer unable to apply on " + "seeding device %s\n", device->name); + ret = -EINVAL; + goto out_free; + } + if (!strcmp(sizestr, "max")) new_size = device->bdev->bd_inode->i_size; else { -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Liu Bo
2012-Jun-14 08:23 UTC
[PATCH 04/10 RESEND] Btrfs: avoid memory leak of extent state in error handling routine
We''ve forgotten to clear extent states in pinned tree, which will results in space counter mismatch and memory leak: WARNING: at fs/btrfs/extent-tree.c:7537 btrfs_free_block_groups+0x1f3/0x2e0 [btrfs]() ... space_info 2 has 8380416 free, is not full space_info total=12582912, used=4096, pinned=4096, reserved=0, may_use=0, readonly=4194304 btrfs state leak: start 29364224 end 29376511 state 1 in tree ffff880075f20090 refs 1 ... Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> --- fs/btrfs/disk-io.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index b99d512..1030cff 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3600,6 +3600,8 @@ void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans, btrfs_destroy_marked_extents(root, &cur_trans->dirty_pages, EXTENT_DIRTY); + btrfs_destroy_pinned_extent(root, + root->fs_info->pinned_extents); /* memset(cur_trans, 0, sizeof(*cur_trans)); -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Liu Bo
2012-Jun-14 08:23 UTC
[PATCH 05/10 RESEND] Btrfs: make sure that we''ve made everything in pinned tree clean
Since we have two trees for recording pinned extents, we need to go through both of them to make sure that we''ve done everything clean. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> --- fs/btrfs/disk-io.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 1030cff..61deaa6 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3553,8 +3553,10 @@ static int btrfs_destroy_pinned_extent(struct btrfs_root *root, u64 start; u64 end; int ret; + bool loop = true; unpin = pinned_extents; +again: while (1) { ret = find_first_extent_bit(unpin, 0, &start, &end, EXTENT_DIRTY); @@ -3572,6 +3574,15 @@ static int btrfs_destroy_pinned_extent(struct btrfs_root *root, cond_resched(); } + if (loop) { + if (unpin == &root->fs_info->freed_extents[0]) + unpin = &root->fs_info->freed_extents[1]; + else + unpin = &root->fs_info->freed_extents[0]; + loop = false; + goto again; + } + return 0; } -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Liu Bo
2012-Jun-14 08:23 UTC
[PATCH 06/10 RESEND] Btrfs: destroy the items of the delayed inodes in error handling routine
From: Miao Xie <miaox@cn.fujitsu.com> the items of the delayed inodes were forgotten to be freed, this patch fixes it. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> --- fs/btrfs/delayed-inode.c | 18 ++++++++++++++++++ fs/btrfs/delayed-inode.h | 3 +++ fs/btrfs/disk-io.c | 6 ++++++ 3 files changed, 27 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index c18d044..2399f40 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1879,3 +1879,21 @@ void btrfs_kill_all_delayed_nodes(struct btrfs_root *root) } } } + +void btrfs_destroy_delayed_inodes(struct btrfs_root *root) +{ + struct btrfs_delayed_root *delayed_root; + struct btrfs_delayed_node *curr_node, *prev_node; + + delayed_root = btrfs_get_delayed_root(root); + + curr_node = btrfs_first_delayed_node(delayed_root); + while (curr_node) { + __btrfs_kill_delayed_node(curr_node); + + prev_node = curr_node; + curr_node = btrfs_next_delayed_node(curr_node); + btrfs_release_delayed_node(prev_node); + } +} + diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h index 7083d08..f5aa402 100644 --- a/fs/btrfs/delayed-inode.h +++ b/fs/btrfs/delayed-inode.h @@ -124,6 +124,9 @@ int btrfs_fill_inode(struct inode *inode, u32 *rdev); /* Used for drop dead root */ void btrfs_kill_all_delayed_nodes(struct btrfs_root *root); +/* Used for clean the transaction */ +void btrfs_destroy_delayed_inodes(struct btrfs_root *root); + /* Used for readdir() */ void btrfs_get_delayed_items(struct inode *inode, struct list_head *ins_list, struct list_head *del_list); diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 61deaa6..d16f4ce 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3607,6 +3607,9 @@ void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans, if (waitqueue_active(&cur_trans->commit_wait)) wake_up(&cur_trans->commit_wait); + btrfs_destroy_delayed_inodes(root); + btrfs_assert_delayed_root_empty(root); + btrfs_destroy_pending_snapshots(cur_trans); btrfs_destroy_marked_extents(root, &cur_trans->dirty_pages, @@ -3661,6 +3664,9 @@ int btrfs_cleanup_transaction(struct btrfs_root *root) if (waitqueue_active(&t->commit_wait)) wake_up(&t->commit_wait); + btrfs_destroy_delayed_inodes(root); + btrfs_assert_delayed_root_empty(root); + btrfs_destroy_pending_snapshots(t); btrfs_destroy_delalloc_inodes(root); -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Liu Bo
2012-Jun-14 08:23 UTC
[PATCH 07/10 trival] Btrfs: fix typo in btrfs_finish_ordered_io
Fix typo errors in comments of btrfs_finish_ordered_io. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> --- fs/btrfs/inode.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index bc66330..3bb6b25 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1929,8 +1929,8 @@ out: ordered_extent->len - 1, NULL, GFP_NOFS); /* - * This needs to be dont to make sure anybody waiting knows we are done - * upating everything for this ordered extent. + * This needs to be done to make sure anybody waiting knows we are done + * updating everything for this ordered extent. */ btrfs_remove_ordered_extent(inode, ordered_extent); -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
It should be 10 * 1024 * 1024. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> --- fs/btrfs/inode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 3bb6b25..da2fd8e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1031,7 +1031,7 @@ static int cow_file_range_async(struct inode *inode, struct page *locked_page, struct btrfs_root *root = BTRFS_I(inode)->root; unsigned long nr_pages; u64 cur_end; - int limit = 10 * 1024 * 1042; + int limit = 10 * 1024 * 1024; clear_extent_bit(&BTRFS_I(inode)->io_tree, start, end, EXTENT_LOCKED, 1, 0, NULL, GFP_NOFS); -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Liu Bo
2012-Jun-14 08:23 UTC
[PATCH 09/10] Btrfs: update MAINTAINERS info for BTRFS FILE SYSTEM
Update to the latest btrfs''s maintainer mail and git repo. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> --- MAINTAINERS | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index b362709..8bfa7f9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1630,11 +1630,11 @@ S: Maintained F: drivers/gpio/gpio-bt8xx.c BTRFS FILE SYSTEM -M: Chris Mason <chris.mason@oracle.com> +M: Chris Mason <chris.mason@fusionio.com> L: linux-btrfs@vger.kernel.org W: http://btrfs.wiki.kernel.org/ Q: http://patchwork.kernel.org/project/linux-btrfs/list/ -T: git git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git +T: git git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git S: Maintained F: Documentation/filesystems/btrfs.txt F: fs/btrfs/ -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Use wrapper page_offset to get byte-offset into filesystem object for page. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> --- fs/btrfs/disk-io.c | 2 +- fs/btrfs/extent_io.c | 20 ++++++++++---------- fs/btrfs/inode.c | 2 +- fs/btrfs/relocation.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index d16f4ce..97f4837 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -420,7 +420,7 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root, static int csum_dirty_buffer(struct btrfs_root *root, struct page *page) { struct extent_io_tree *tree; - u64 start = (u64)page->index << PAGE_CACHE_SHIFT; + u64 start = (u64)page_offset(page); u64 found_start; struct extent_buffer *eb; diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 2c8f7b2..6afbcf1 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1780,7 +1780,7 @@ int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end, */ static void check_page_uptodate(struct extent_io_tree *tree, struct page *page) { - u64 start = (u64)page->index << PAGE_CACHE_SHIFT; + u64 start = (u64)page_offset(page); u64 end = start + PAGE_CACHE_SIZE - 1; if (test_range_bit(tree, start, end, EXTENT_UPTODATE, 1, NULL)) SetPageUptodate(page); @@ -1792,7 +1792,7 @@ static void check_page_uptodate(struct extent_io_tree *tree, struct page *page) */ static void check_page_locked(struct extent_io_tree *tree, struct page *page) { - u64 start = (u64)page->index << PAGE_CACHE_SHIFT; + u64 start = (u64)page_offset(page); u64 end = start + PAGE_CACHE_SIZE - 1; if (!test_range_bit(tree, start, end, EXTENT_LOCKED, 0, NULL)) unlock_page(page); @@ -2241,7 +2241,7 @@ static void end_bio_extent_writepage(struct bio *bio, int err) struct page *page = bvec->bv_page; tree = &BTRFS_I(page->mapping->host)->io_tree; - start = ((u64)page->index << PAGE_CACHE_SHIFT) + + start = ((u64)page_offset(page)) + bvec->bv_offset; end = start + bvec->bv_len - 1; @@ -2301,7 +2301,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err) (long int)bio->bi_bdev); tree = &BTRFS_I(page->mapping->host)->io_tree; - start = ((u64)page->index << PAGE_CACHE_SHIFT) + + start = ((u64)page_offset(page)) + bvec->bv_offset; end = start + bvec->bv_len - 1; @@ -2436,7 +2436,7 @@ static int __must_check submit_one_bio(int rw, struct bio *bio, struct extent_io_tree *tree = bio->bi_private; u64 start; - start = ((u64)page->index << PAGE_CACHE_SHIFT) + bvec->bv_offset; + start = ((u64)page_offset(page)) + bvec->bv_offset; bio->bi_private = NULL; @@ -2560,7 +2560,7 @@ static int __extent_read_full_page(struct extent_io_tree *tree, unsigned long *bio_flags) { struct inode *inode = page->mapping->host; - u64 start = (u64)page->index << PAGE_CACHE_SHIFT; + u64 start = (u64)page_offset(page); u64 page_end = start + PAGE_CACHE_SIZE - 1; u64 end; u64 cur = start; @@ -2768,7 +2768,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc, struct inode *inode = page->mapping->host; struct extent_page_data *epd = data; struct extent_io_tree *tree = epd->tree; - u64 start = (u64)page->index << PAGE_CACHE_SHIFT; + u64 start = (u64)page_offset(page); u64 delalloc_start; u64 page_end = start + PAGE_CACHE_SIZE - 1; u64 end; @@ -3570,7 +3570,7 @@ int extent_invalidatepage(struct extent_io_tree *tree, struct page *page, unsigned long offset) { struct extent_state *cached_state = NULL; - u64 start = ((u64)page->index << PAGE_CACHE_SHIFT); + u64 start = (u64)page_offset(page); u64 end = start + PAGE_CACHE_SIZE - 1; size_t blocksize = page->mapping->host->i_sb->s_blocksize; @@ -3596,7 +3596,7 @@ int try_release_extent_state(struct extent_map_tree *map, struct extent_io_tree *tree, struct page *page, gfp_t mask) { - u64 start = (u64)page->index << PAGE_CACHE_SHIFT; + u64 start = (u64)page_offset(page); u64 end = start + PAGE_CACHE_SIZE - 1; int ret = 1; @@ -3635,7 +3635,7 @@ int try_release_extent_mapping(struct extent_map_tree *map, gfp_t mask) { struct extent_map *em; - u64 start = (u64)page->index << PAGE_CACHE_SHIFT; + u64 start = (u64)page_offset(page); u64 end = start + PAGE_CACHE_SIZE - 1; if ((mask & __GFP_WAIT) && diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index da2fd8e..94e23da 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1984,7 +1984,7 @@ static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end, static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end, struct extent_state *state, int mirror) { - size_t offset = start - ((u64)page->index << PAGE_CACHE_SHIFT); + size_t offset = start - ((u64)page_offset(page)); struct inode *inode = page->mapping->host; struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; char *kaddr; diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 646ee21..60bb8e1 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -3016,7 +3016,7 @@ static int relocate_file_extent_cluster(struct inode *inode, } } - page_start = (u64)page->index << PAGE_CACHE_SHIFT; + page_start = (u64)page_offset(page); page_end = page_start + PAGE_CACHE_SIZE - 1; lock_extent(&BTRFS_I(inode)->io_tree, page_start, page_end); -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
David Sterba
2012-Jun-14 10:03 UTC
Re: [PATCH 01/10] Btrfs: remove unused FS_NOCOMP_FL check in setflags and getflags
On Thu, Jun 14, 2012 at 04:23:17PM +0800, Liu Bo wrote:> chattr only uses FS_COMPR_FL to switch on/off the compression flag, > so we don''t need these FS_NOCOMP_FL checks.Please drop this patch. The FS_NOCOMP_FL has a different meaning, it forces the filesystem to completely avoid compression of the file. FS_COMPR_FL tells the fs to compress the file, even if the filesystem is not mounted with compression. And none of the two flags means ''let the fs pick according to current defaults'', ie when the fs is moutned with compression (or not). As a user, I have a fine grained control over the per-file compression status. We need to chattr/lsattr to support the existing NOCOMP flag, I''d like to see a letter ''Z'' assigned for it, but it''s currently occupied by { FS_DIRTY_FL, ''Z'', "Compressed_Dirty_File" } (though I''m not sure if the compression-related flags are actually used at all around the extN filesystems). Maybe ''z'' is a good choice here as well, I don''t mind. david -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
David Sterba
2012-Jun-14 10:12 UTC
Re: [PATCH 02/10] Btrfs: fix missing inherited flag in rename
On Thu, Jun 14, 2012 at 04:23:18PM +0800, Liu Bo wrote:> When we move a file into a directory with compression flag, we need to > inherite BTRFS_INODE_COMPRESS and clear BTRFS_INODE_NOCOMPRESS as well.Right.> But if we move a file into a directory without compression flag, we need > to clear both of them.Right. And now thinking about it, the _NOCOMPRESS should be honored as well, not dropped. The expected use here is to set a NOCOMP flag on the directory and let it inherit for all newly created files/dirs> It is the way how our setflags deals with compression flag, so keep > the same behaviour here.Yeah, keep it the same :) Priority of all the compression flags may not be clear, the NOCOMPRESS has precedence over COMPRESS, as it attempts to avoid pointless file compression. Both per-file flags are preferred over compression mount option. david -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
David Sterba
2012-Jun-14 10:17 UTC
Re: [PATCH 08/10 trival] Btrfs: fix typo in cow_file_range_async
On Thu, Jun 14, 2012 at 04:23:24PM +0800, Liu Bo wrote:> It should be 10 * 1024 * 1024.Nice one :) though there''s another one a few lines above 1010 if (atomic_read(&root->fs_info->async_delalloc_pages) < 1011 5 * 1042 * 1024 && 1012 waitqueue_active(&root->fs_info->async_submit_wait)) 1013 wake_up(&root->fs_info->async_submit_wait); 1014 can you please fix both? david -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Liu Bo
2012-Jun-14 11:11 UTC
Re: [PATCH 08/10 trival] Btrfs: fix typo in cow_file_range_async
On 06/14/2012 06:17 PM, David Sterba wrote:> On Thu, Jun 14, 2012 at 04:23:24PM +0800, Liu Bo wrote: >> It should be 10 * 1024 * 1024. > > Nice one :) though there''s another one a few lines above > > 1010 if (atomic_read(&root->fs_info->async_delalloc_pages) < > 1011 5 * 1042 * 1024 && > 1012 waitqueue_active(&root->fs_info->async_submit_wait)) > 1013 wake_up(&root->fs_info->async_submit_wait); > 1014 > > can you please fix both? >Sure, will update it. thanks, liubo> > david > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >-- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html