Btrfs: don't change inode flag of the dest clone file
authorLi Zefan <lizf@cn.fujitsu.com>
Sun, 18 Sep 2011 14:20:46 +0000 (10:20 -0400)
committerChris Mason <chris.mason@oracle.com>
Sun, 18 Sep 2011 14:20:46 +0000 (10:20 -0400)
The dst file will have the same inode flags with dst file after
file clone, and I think it's unexpected.

For example, the dst file will suddenly become immutable after
getting some share of data with src file, if the src is immutable.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ioctl.c

index 1e766e86f33402a912dfd851ac66a8ebe4446c23..9947a0ac7bd5958a3445908ca495d389acd0ae58 100644 (file)
@@ -2455,7 +2455,6 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
                        if (endoff > inode->i_size)
                                btrfs_i_size_write(inode, endoff);
 
-                       BTRFS_I(inode)->flags = BTRFS_I(src)->flags;
                        ret = btrfs_update_inode(trans, root, inode);
                        BUG_ON(ret);
                        btrfs_end_transaction(trans, root);