aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2011-04-14 23:03:17 -0400
committerChris Mason <chris.mason@oracle.com>2011-05-14 16:10:28 -0400
commitebcb904dfe31644857422e3bb62e50f76fe86255 (patch)
treee4dd906d7f15e0a924b410acd236e8b7e3bc8bba /fs/btrfs/ioctl.c
parentd0092bdda819914b8725da76a8c33eb06eb0bd21 (diff)
Btrfs: fix FS_IOC_SETFLAGS ioctl
Steps to reproduce the bug: - Call FS_IOC_SETLFAGS ioctl with flags=FS_COMPR_FL - Call FS_IOC_SETFLAGS ioctl with flags=0 - Call FS_IOC_GETFLAGS ioctl, and you'll see FS_COMPR_FL is still set! Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index aeabf6b6ccc8..3e7031d32eef 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -238,6 +238,8 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
238 } else if (flags & FS_COMPR_FL) { 238 } else if (flags & FS_COMPR_FL) {
239 ip->flags |= BTRFS_INODE_COMPRESS; 239 ip->flags |= BTRFS_INODE_COMPRESS;
240 ip->flags &= ~BTRFS_INODE_NOCOMPRESS; 240 ip->flags &= ~BTRFS_INODE_NOCOMPRESS;
241 } else {
242 ip->flags &= ~(BTRFS_INODE_COMPRESS | BTRFS_INODE_NOCOMPRESS);
241 } 243 }
242 244
243 trans = btrfs_join_transaction(root, 1); 245 trans = btrfs_join_transaction(root, 1);