|
@@ -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. */
|