From: Li Zefan Date: Fri, 15 Apr 2011 03:03:17 +0000 (+0000) Subject: Btrfs: fix FS_IOC_SETFLAGS ioctl X-Git-Tag: firefly_0821_release~7613^2~1434^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ebcb904dfe31644857422e3bb62e50f76fe86255;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Chris Mason --- 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) } else if (flags & FS_COMPR_FL) { ip->flags |= BTRFS_INODE_COMPRESS; ip->flags &= ~BTRFS_INODE_NOCOMPRESS; + } else { + ip->flags &= ~(BTRFS_INODE_COMPRESS | BTRFS_INODE_NOCOMPRESS); } trans = btrfs_join_transaction(root, 1);