]> granicus.if.org Git - zfs/commit
Prevent xattr remove from creating xattr directory
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 28 Oct 2013 16:07:00 +0000 (09:07 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 29 Oct 2013 20:23:53 +0000 (13:23 -0700)
commitfc9e0530c9b1be00c122f88d9e4c8c329f2d5d26
tree3ba6217d51724af4019ef6b568196ce7d789e827
parent37fd6e00a699aff3fea24199497e9484cd218a84
Prevent xattr remove from creating xattr directory

Attempting to remove an xattr from a file which does not contain
any directory based xattrs would result in the xattr directory
being created.  This behavior is non-optimal because it results
in write operations to the pool in addition to the expected error
being returned.

To prevent this the CREATE_XATTR_DIR flag is only passed in
zpl_xattr_set_dir() when setting a non-NULL xattr value.  In
addition, zpl_xattr_set() is updated similarly such that it will
return immediately if passed an xattr name which doesn't exist
and a NULL value.

Signed-off-by: Massimo Maggi <me@massimo-maggi.eu>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #170
module/zfs/zpl_xattr.c