Btrfs: disable xattr operations on subvolume directories
authorOmar Sandoval <osandov@fb.com>
Thu, 26 Jan 2017 01:06:39 +0000 (17:06 -0800)
committerChris Mason <clm@fb.com>
Thu, 26 Jan 2017 23:48:55 +0000 (15:48 -0800)
commit1fdf41941b8010691679638f8d0c8d08cfee7726
treea30a3e78422bb68feae6e32ad13db1327bc95a67
parent67ade058ef2c65a3e56878af9c293ec76722a2e5
Btrfs: disable xattr operations on subvolume directories

When you snapshot a subvolume containing a subvolume, you get a
placeholder directory where the subvolume would be. These directory
inodes have ->i_ops set to btrfs_dir_ro_inode_operations. Previously,
these i_ops didn't include the xattr operation callbacks. The conversion
to xattr_handlers missed this case, leading to bogus attempts to set
xattrs on these inodes. This manifested itself as failures when running
delayed inodes.

To fix this, clear IOP_XATTR in ->i_opflags on these inodes.

Fixes: 6c6ef9f26e59 ("xattr: Stop calling {get,set,remove}xattr inode operations")
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Reported-by: Chris Murphy <lists@colorremedies.com>
Tested-by: Chris Murphy <lists@colorremedies.com>
Cc: <stable@vger.kernel.org> # 4.9.x
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/inode.c