Skip to content

Commit be20aa0

Browse files
jtlaytonJ. Bruce Fields
authored andcommitted
nfsd: don't hold ls_mutex across a layout recall
We do need to serialize layout stateid morphing operations, but we currently hold the ls_mutex across a layout recall which is pretty ugly. It's also unnecessary -- once we've bumped the seqid and copied it, we don't need to serialize the rest of the CB_LAYOUTRECALL vs. anything else. Just drop the mutex once the copy is done. This was causing a "workqueue leaked lock or atomic" warning and an occasional deadlock. There's more work to be done here but this fixes the immediate regression. Fixes: cc8a553 "nfsd: serialize layout stateid morphing operations" Cc: stable@vger.kernel.org Reported-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Jeff Layton <jeff.layton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent 8005c49 commit be20aa0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfsd/nfs4layouts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ nfsd4_cb_layout_prepare(struct nfsd4_callback *cb)
616616

617617
mutex_lock(&ls->ls_mutex);
618618
nfs4_inc_and_copy_stateid(&ls->ls_recall_sid, &ls->ls_stid);
619+
mutex_unlock(&ls->ls_mutex);
619620
}
620621

621622
static int
@@ -659,7 +660,6 @@ nfsd4_cb_layout_release(struct nfsd4_callback *cb)
659660

660661
trace_layout_recall_release(&ls->ls_stid.sc_stateid);
661662

662-
mutex_unlock(&ls->ls_mutex);
663663
nfsd4_return_all_layouts(ls, &reaplist);
664664
nfsd4_free_layouts(&reaplist);
665665
nfs4_put_stid(&ls->ls_stid);

0 commit comments

Comments
 (0)