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

staging: lustre: llite: fix invalid size test in ll_setstripe_ea()

The size check at the start of ll_setstripe_ea() is only
valid for a directory. Move that check to the section of
code handling the S_ISDIR case.
Signed-off-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183
Reviewed-on: https://review.whamcloud.com/27240Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarBob Glossman <bob.glossman@intel.com>
Reviewed-by: default avatarSebastien Buisson <sbuisson@ddn.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 13050238
......@@ -234,9 +234,6 @@ static int ll_setstripe_ea(struct dentry *dentry, struct lov_user_md *lump,
struct inode *inode = d_inode(dentry);
int rc = 0;
if (size != 0 && size < sizeof(struct lov_user_md))
return -EINVAL;
/*
* It is possible to set an xattr to a "" value of zero size.
* For this case we are going to treat it as a removal.
......@@ -269,6 +266,9 @@ static int ll_setstripe_ea(struct dentry *dentry, struct lov_user_md *lump,
if (rc == -EEXIST)
rc = 0;
} else if (S_ISDIR(inode->i_mode)) {
if (size != 0 && size < sizeof(struct lov_user_md))
return -EINVAL;
rc = ll_dir_setstripe(inode, lump, 0);
}
......
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