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
This commit is contained in:
Linus Torvalds 2013-06-01 06:59:14 +09:00
Родитель 7cfb953258 a1457c0ce9
Коммит 1d822d6094
4 изменённых файлов: 25 добавлений и 3 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -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;