Commit 1d822d60 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull reiserfs fixes from Jan Kara:
 "Three reiserfs fixes.  They fix real problems spotted by users so I
  hope they are ok even at this stage."

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  reiserfs: fix deadlock with nfs racing on create/lookup
  reiserfs: fix problems with chowning setuid file w/ xattrs
  reiserfs: fix spurious multiple-fill in reiserfs_readdir_dentry
parents 7cfb9532 a1457c0c
...@@ -204,6 +204,8 @@ int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent, ...@@ -204,6 +204,8 @@ int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent,
next_pos = deh_offset(deh) + 1; next_pos = deh_offset(deh) + 1;
if (item_moved(&tmp_ih, &path_to_entry)) { if (item_moved(&tmp_ih, &path_to_entry)) {
set_cpu_key_k_offset(&pos_key,
next_pos);
goto research; goto research;
} }
} /* for */ } /* for */
......
...@@ -1811,11 +1811,16 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -1811,11 +1811,16 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
TYPE_STAT_DATA, SD_SIZE, MAX_US_INT); TYPE_STAT_DATA, SD_SIZE, MAX_US_INT);
memcpy(INODE_PKEY(inode), &(ih.ih_key), KEY_SIZE); memcpy(INODE_PKEY(inode), &(ih.ih_key), KEY_SIZE);
args.dirid = le32_to_cpu(ih.ih_key.k_dir_id); args.dirid = le32_to_cpu(ih.ih_key.k_dir_id);
if (insert_inode_locked4(inode, args.objectid,
reiserfs_find_actor, &args) < 0) { reiserfs_write_unlock(inode->i_sb);
err = insert_inode_locked4(inode, args.objectid,
reiserfs_find_actor, &args);
reiserfs_write_lock(inode->i_sb);
if (err) {
err = -EINVAL; err = -EINVAL;
goto out_bad_inode; goto out_bad_inode;
} }
if (old_format_only(sb)) if (old_format_only(sb))
/* not a perfect generation count, as object ids can be reused, but /* not a perfect generation count, as object ids can be reused, but
** this is as good as reiserfs can do right now. ** this is as good as reiserfs can do right now.
......
...@@ -318,7 +318,19 @@ static int delete_one_xattr(struct dentry *dentry, void *data) ...@@ -318,7 +318,19 @@ static int delete_one_xattr(struct dentry *dentry, void *data)
static int chown_one_xattr(struct dentry *dentry, void *data) static int chown_one_xattr(struct dentry *dentry, void *data)
{ {
struct iattr *attrs = 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. */ /* No i_mutex, but the inode is unconnected. */
......
...@@ -443,6 +443,9 @@ int reiserfs_acl_chmod(struct inode *inode) ...@@ -443,6 +443,9 @@ int reiserfs_acl_chmod(struct inode *inode)
int depth; int depth;
int error; int error;
if (IS_PRIVATE(inode))
return 0;
if (S_ISLNK(inode->i_mode)) if (S_ISLNK(inode->i_mode))
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
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