提交 be20aa00 编写于 作者: J Jeff Layton 提交者: J. Bruce Fields

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: cc8a5532 "nfsd: serialize layout stateid morphing operations"
Cc: stable@vger.kernel.org
Reported-by: NKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 8005c49d
...@@ -616,6 +616,7 @@ nfsd4_cb_layout_prepare(struct nfsd4_callback *cb) ...@@ -616,6 +616,7 @@ nfsd4_cb_layout_prepare(struct nfsd4_callback *cb)
mutex_lock(&ls->ls_mutex); mutex_lock(&ls->ls_mutex);
nfs4_inc_and_copy_stateid(&ls->ls_recall_sid, &ls->ls_stid); nfs4_inc_and_copy_stateid(&ls->ls_recall_sid, &ls->ls_stid);
mutex_unlock(&ls->ls_mutex);
} }
static int static int
...@@ -659,7 +660,6 @@ nfsd4_cb_layout_release(struct nfsd4_callback *cb) ...@@ -659,7 +660,6 @@ nfsd4_cb_layout_release(struct nfsd4_callback *cb)
trace_layout_recall_release(&ls->ls_stid.sc_stateid); trace_layout_recall_release(&ls->ls_stid.sc_stateid);
mutex_unlock(&ls->ls_mutex);
nfsd4_return_all_layouts(ls, &reaplist); nfsd4_return_all_layouts(ls, &reaplist);
nfsd4_free_layouts(&reaplist); nfsd4_free_layouts(&reaplist);
nfs4_put_stid(&ls->ls_stid); nfs4_put_stid(&ls->ls_stid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册