aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorLiu Bo <liubo2009@cn.fujitsu.com>2012-06-14 04:23:18 -0400
committerChris Mason <chris.mason@oracle.com>2012-06-15 11:33:30 -0400
commitbc1782374b128103ae9689e0753e0610f35b6bfd (patch)
tree876bb3e67c5163b238418493e44e1e865c8c85be /fs/btrfs/inode.c
parentacbcabd2de05f331c51700773f701e90bd7f74dc (diff)
Btrfs: fix missing inherited flag in rename
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> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 7a090fb4eb98..3f2c8cbe5ba6 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7122,10 +7122,13 @@ static void fixup_inode_flags(struct inode *dir, struct inode *inode)
7122 else 7122 else
7123 b_inode->flags &= ~BTRFS_INODE_NODATACOW; 7123 b_inode->flags &= ~BTRFS_INODE_NODATACOW;
7124 7124
7125 if (b_dir->flags & BTRFS_INODE_COMPRESS) 7125 if (b_dir->flags & BTRFS_INODE_COMPRESS) {
7126 b_inode->flags |= BTRFS_INODE_COMPRESS; 7126 b_inode->flags |= BTRFS_INODE_COMPRESS;
7127 else 7127 b_inode->flags &= ~BTRFS_INODE_NOCOMPRESS;
7128 b_inode->flags &= ~BTRFS_INODE_COMPRESS; 7128 } else {
7129 b_inode->flags &= ~(BTRFS_INODE_COMPRESS |
7130 BTRFS_INODE_NOCOMPRESS);
7131 }
7129} 7132}
7130 7133
7131static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, 7134static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,