Skip to content

Commit c968fd2

Browse files
author
Trond Myklebust
committed
NFSv4.0: Fix the wake up of the next waiter in nfs_release_seqid()
There is no need to wake up another waiter on the seqid list unless the seqid being removed is at the head of the list, and so is relinquishing control of the sequence counter to the next entry. Reviewed-by: Yang Erkun <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 675d456 commit c968fd2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

fs/nfs/nfs4state.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,14 +1083,12 @@ void nfs_release_seqid(struct nfs_seqid *seqid)
10831083
return;
10841084
sequence = seqid->sequence;
10851085
spin_lock(&sequence->lock);
1086-
list_del_init(&seqid->list);
1087-
if (!list_empty(&sequence->list)) {
1088-
struct nfs_seqid *next;
1089-
1090-
next = list_first_entry(&sequence->list,
1091-
struct nfs_seqid, list);
1086+
if (list_is_first(&seqid->list, &sequence->list) &&
1087+
!list_is_singular(&sequence->list)) {
1088+
struct nfs_seqid *next = list_next_entry(seqid, list);
10921089
rpc_wake_up_queued_task(&sequence->wait, next->task);
10931090
}
1091+
list_del_init(&seqid->list);
10941092
spin_unlock(&sequence->lock);
10951093
}
10961094

0 commit comments

Comments
 (0)