提交 12423d11 编写于 作者: T Trond Myklebust 提交者: Zheng Zengkai

NFS/pNFS: Don't call pnfs_free_bucket_lseg() before removing the request

stable inclusion
from stable-5.10.9
commit 067aefcdfc1e50662b9ac80d3662c4fff3075313
bugzilla: 47457

--------------------------------

commit 1757655d upstream.

In pnfs_generic_clear_request_commit(), we try calling
pnfs_free_bucket_lseg() before we remove the request from the DS bucket.
That will always fail, since the point is to test for whether or not
that bucket is empty.

Fixes: c84bea59 ("NFS/pNFS: Simplify bucket layout segment reference counting")
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 b43da565
...@@ -78,22 +78,18 @@ void ...@@ -78,22 +78,18 @@ void
pnfs_generic_clear_request_commit(struct nfs_page *req, pnfs_generic_clear_request_commit(struct nfs_page *req,
struct nfs_commit_info *cinfo) struct nfs_commit_info *cinfo)
{ {
struct pnfs_layout_segment *freeme = NULL; struct pnfs_commit_bucket *bucket = NULL;
if (!test_and_clear_bit(PG_COMMIT_TO_DS, &req->wb_flags)) if (!test_and_clear_bit(PG_COMMIT_TO_DS, &req->wb_flags))
goto out; goto out;
cinfo->ds->nwritten--; cinfo->ds->nwritten--;
if (list_is_singular(&req->wb_list)) { if (list_is_singular(&req->wb_list))
struct pnfs_commit_bucket *bucket;
bucket = list_first_entry(&req->wb_list, bucket = list_first_entry(&req->wb_list,
struct pnfs_commit_bucket, struct pnfs_commit_bucket, written);
written);
freeme = pnfs_free_bucket_lseg(bucket);
}
out: out:
nfs_request_remove_commit_list(req, cinfo); nfs_request_remove_commit_list(req, cinfo);
pnfs_put_lseg(freeme); if (bucket)
pnfs_put_lseg(pnfs_free_bucket_lseg(bucket));
} }
EXPORT_SYMBOL_GPL(pnfs_generic_clear_request_commit); EXPORT_SYMBOL_GPL(pnfs_generic_clear_request_commit);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册