summaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/xattr.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-09 06:27:51 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-09 06:27:51 +0200
commit141dc40ee343ab532717b235dd645e2d25ae3092 (patch)
tree2289e5d1ec20df5e465b9b629e291877f4d70485 /fs/reiserfs/xattr.c
parentMerge tag 'for-usb-next-2013-06-06' of git://git.kernel.org/pub/scm/linux/ker... (diff)
parentLinux 3.10-rc5 (diff)
downloadlinux-141dc40ee343ab532717b235dd645e2d25ae3092.tar.xz
linux-141dc40ee343ab532717b235dd645e2d25ae3092.zip
Merge 3.10-rc5 into usb-next
We need the changes in this branch. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/reiserfs/xattr.c')
-rw-r--r--fs/reiserfs/xattr.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 4cce1d9552fb..821bcf70e467 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -318,7 +318,19 @@ static int delete_one_xattr(struct dentry *dentry, void *data)
static int chown_one_xattr(struct dentry *dentry, void *data)
{
struct iattr *attrs = data;
- return reiserfs_setattr(dentry, attrs);
+ int ia_valid = attrs->ia_valid;
+ int err;
+
+ /*
+ * We only want the ownership bits. Otherwise, we'll do
+ * things like change a directory to a regular file if
+ * ATTR_MODE is set.
+ */
+ attrs->ia_valid &= (ATTR_UID|ATTR_GID);
+ err = reiserfs_setattr(dentry, attrs);
+ attrs->ia_valid = ia_valid;
+
+ return err;
}
/* No i_mutex, but the inode is unconnected. */