Skip to content

Commit

Permalink
Merge tag 'nfs-for-4.20-1' of git://git.linux-nfs.org/projects/trondm…
Browse files Browse the repository at this point in the history
…y/linux-nfs

backmerge to do fixup of iov_iter_kvec() conflict
  • Loading branch information
Al Viro committed Nov 1, 2018
2 parents 3bf0fb6 + 331bc71 commit 78a63f1
Show file tree
Hide file tree
Showing 57 changed files with 2,481 additions and 2,039 deletions.
17 changes: 9 additions & 8 deletions fs/nfs/delegation.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ int nfs4_check_delegation(struct inode *inode, fmode_t flags)
return nfs4_do_check_delegation(inode, flags, false);
}

static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid)
static int nfs_delegation_claim_locks(struct nfs4_state *state, const nfs4_stateid *stateid)
{
struct inode *inode = state->inode;
struct file_lock *fl;
Expand All @@ -108,7 +108,7 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
spin_lock(&flctx->flc_lock);
restart:
list_for_each_entry(fl, list, fl_list) {
if (nfs_file_open_context(fl->fl_file) != ctx)
if (nfs_file_open_context(fl->fl_file)->state != state)
continue;
spin_unlock(&flctx->flc_lock);
status = nfs4_lock_delegation_recall(fl, state, stateid);
Expand Down Expand Up @@ -136,8 +136,8 @@ static int nfs_delegation_claim_opens(struct inode *inode,
int err;

again:
spin_lock(&inode->i_lock);
list_for_each_entry(ctx, &nfsi->open_files, list) {
rcu_read_lock();
list_for_each_entry_rcu(ctx, &nfsi->open_files, list) {
state = ctx->state;
if (state == NULL)
continue;
Expand All @@ -147,15 +147,16 @@ static int nfs_delegation_claim_opens(struct inode *inode,
continue;
if (!nfs4_stateid_match(&state->stateid, stateid))
continue;
get_nfs_open_context(ctx);
spin_unlock(&inode->i_lock);
if (!get_nfs_open_context(ctx))
continue;
rcu_read_unlock();
sp = state->owner;
/* Block nfs4_proc_unlck */
mutex_lock(&sp->so_delegreturn_mutex);
seq = raw_seqcount_begin(&sp->so_reclaim_seqcount);
err = nfs4_open_delegation_recall(ctx, state, stateid, type);
if (!err)
err = nfs_delegation_claim_locks(ctx, state, stateid);
err = nfs_delegation_claim_locks(state, stateid);
if (!err && read_seqcount_retry(&sp->so_reclaim_seqcount, seq))
err = -EAGAIN;
mutex_unlock(&sp->so_delegreturn_mutex);
Expand All @@ -164,7 +165,7 @@ static int nfs_delegation_claim_opens(struct inode *inode,
return err;
goto again;
}
spin_unlock(&inode->i_lock);
rcu_read_unlock();
return 0;
}

Expand Down
Loading

0 comments on commit 78a63f1

Please sign in to comment.