Commit 1b60f6df authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: llite: correct removexattr detection

In ll_xattr_set_common() detect the removexattr() case correctly by
testing for a NULL value as well as XATTR_REPLACE.
Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10787
Reviewed-on: https://review.whamcloud.com/Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ab42bc01
......@@ -94,7 +94,11 @@ static int ll_xattr_set_common(const struct xattr_handler *handler,
u64 valid;
int rc;
if (flags == XATTR_REPLACE) {
/* When setxattr() is called with a size of 0 the value is
* unconditionally replaced by "". When removexattr() is
* called we get a NULL value and XATTR_REPLACE for flags.
*/
if (!value && flags == XATTR_REPLACE) {
ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_REMOVEXATTR, 1);
valid = OBD_MD_FLXATTRRM;
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment