Skip to content

Commit

Permalink
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed May 31, 2013
2 parents 7cfb953 + a1457c0 commit 1d822d6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
2 changes: 2 additions & 0 deletions fs/reiserfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent,
next_pos = deh_offset(deh) + 1;

if (item_moved(&tmp_ih, &path_to_entry)) {
set_cpu_key_k_offset(&pos_key,
next_pos);
goto research;
}
} /* for */
Expand Down
9 changes: 7 additions & 2 deletions fs/reiserfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1811,11 +1811,16 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
TYPE_STAT_DATA, SD_SIZE, MAX_US_INT);
memcpy(INODE_PKEY(inode), &(ih.ih_key), KEY_SIZE);
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;
goto out_bad_inode;
}

if (old_format_only(sb))
/* not a perfect generation count, as object ids can be reused, but
** this is as good as reiserfs can do right now.
Expand Down
14 changes: 13 additions & 1 deletion fs/reiserfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
3 changes: 3 additions & 0 deletions fs/reiserfs/xattr_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@ int reiserfs_acl_chmod(struct inode *inode)
int depth;
int error;

if (IS_PRIVATE(inode))
return 0;

if (S_ISLNK(inode->i_mode))
return -EOPNOTSUPP;

Expand Down

0 comments on commit 1d822d6

Please sign in to comment.