From e8a000d8a68d2ad2917a0a5cee20691964a66f3c Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Mon, 4 Feb 2013 20:17:49 -0500 Subject: [PATCH] --- yaml --- r: 352967 b: refs/heads/master c: 9a99af494bd7141d567d00b5ef94b141821e158c h: refs/heads/master i: 352965: f826ba6a8a95013191c80c7ba377815d675bd862 352963: c82addadb210869937cdbf093473222bed2367dc 352959: 1a4448f308908307c7f1540e44175aef373e649d v: v3 --- [refs] | 2 +- trunk/fs/nfs/nfs4proc.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index f6c6614a9cfa..917c8cc67eef 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c137afabe330f64eddcd4dd281258807e27fd430 +refs/heads/master: 9a99af494bd7141d567d00b5ef94b141821e158c diff --git a/trunk/fs/nfs/nfs4proc.c b/trunk/fs/nfs/nfs4proc.c index 62fa4001e47a..92584c1ea725 100644 --- a/trunk/fs/nfs/nfs4proc.c +++ b/trunk/fs/nfs/nfs4proc.c @@ -4813,8 +4813,10 @@ static int nfs41_lock_expired(struct nfs4_state *state, struct file_lock *reques static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock *request) { + struct nfs4_state_owner *sp = state->owner; struct nfs_inode *nfsi = NFS_I(state->inode); unsigned char fl_flags = request->fl_flags; + unsigned int seq; int status = -ENOLCK; if ((fl_flags & FL_POSIX) && @@ -4836,9 +4838,16 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock status = do_vfs_lock(request->fl_file, request); goto out_unlock; } + seq = raw_seqcount_begin(&sp->so_reclaim_seqcount); + up_read(&nfsi->rwsem); status = _nfs4_do_setlk(state, cmd, request, NFS_LOCK_NEW); if (status != 0) + goto out; + down_read(&nfsi->rwsem); + if (read_seqcount_retry(&sp->so_reclaim_seqcount, seq)) { + status = -NFS4ERR_DELAY; goto out_unlock; + } /* Note: we always want to sleep here! */ request->fl_flags = fl_flags | FL_SLEEP; if (do_vfs_lock(request->fl_file, request) < 0)