ceph: fix double free for req when failing to allocate sparse ext map
PATCH 1/1 ceph: fix double free for req when failing to allocate sparse ext map
From: Xiubo Li <[email protected]>
Introduced by commit d1f436736924 ("ceph: add new mount option to enable sparse reads") and will fold this into the above commit since it's still in the testing branch.
--- fs/ceph/addr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
fs/ceph/addr.c +1 -3
@@ -351,10 +351,8 @@ static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq)if (sparse) { err =ceph_alloc_sparse_ext_map (&req->r_ops[0 ]); -if (err) { -ceph_osdc_put_request (req); +if (err) goto out; - } }dout ("%s: pos=%llu orig_len=%zu len=%llu\n" , __func__, subreq->start, subreq->len, len);
Signature · 1 line
2.39.0
Ilya Dryomov
maintainerQuoted 30 lines · On Wed, Jan 11, 2023 at 2:14 AM <[email protected]> wrote:
From: Xiubo Li <[email protected]>
Introduced by commit
d1f436736924("ceph: add new mount option to enable sparse reads") and will fold this into the above commit since it's still in the testing branch.Reported-by Ilya Dryomov <[email protected]>Signed-off-by Xiubo Li <[email protected]>--- fs/ceph/addr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)fs/ceph/addr.c +1
-4@@ -351,10 +351,8 @@ static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq)if (sparse) { err =ceph_alloc_sparse_ext_map (&req->r_ops[0 ]); -if (err) { -ceph_osdc_put_request (req); +if (err) goto out; - } }dout ("%s: pos=%llu orig_len=%zu len=%llu\n" , __func__, subreq->start, subreq->len, len); --
Quoted 2 lines
2.39.0
Hi Xiubo,
Looks good, let's fold this into that commit since it's still testing branch material.
Thanks,
Ilya
Quoted 28 lines · Ilya Dryomov
Quoted 27 lines · On Wed, Jan 11, 2023 at 2:14 AM <[email protected]> wrote:
From: Xiubo Li <[email protected]>
Introduced by commit
d1f436736924("ceph: add new mount option to enable sparse reads") and will fold this into the above commit since it's still in the testing branch.Reported-by Ilya Dryomov <[email protected]>Signed-off-by Xiubo Li <[email protected]>--- fs/ceph/addr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)fs/ceph/addr.c +1
-3@@ -351,10 +351,8 @@ static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq)if (sparse) { err =ceph_alloc_sparse_ext_map (&req->r_ops[0 ]); -if (err) { -ceph_osdc_put_request (req); +if (err) goto out; - } }
Quoted 8 lines
Quoted 4 lines
fs/ceph/addr.c +0
-1dout ("%s: pos=%llu orig_len=%zu len=%llu\n" , __func__, subreq->start, subreq->len, len); --2.39.0
Hi Xiubo,
Looks good, let's fold this into that commit since it's still testing branch material.
Yeah, sure will do.
Thanks
- Xiubo
Quoted 4 lines
Thanks,
Ilya
Signature · 6 lines
Best Regards, Xiubo Li (李秀波) Email: [email protected]/[email protected] Slack: @Xiubo Li
Quoted 18 lines · On Wed, 2023-01-11 at 09:14 +0800, [email protected] wrote:
From: Xiubo Li <[email protected]>
Introduced by commit
d1f436736924("ceph: add new mount option to enable sparse reads") and will fold this into the above commit since it's still in the testing branch.Reported-by Ilya Dryomov <[email protected]>Signed-off-by Xiubo Li <[email protected]>--- fs/ceph/addr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)fs/ceph/addr.c +0
-0@@ -351,10 +351,8 @@ static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq)
fs/ceph/addr.c static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq) · line 358
Quoted 10 lines
fs/ceph/addr.c +1
-3if (sparse) { err =ceph_alloc_sparse_ext_map (&req->r_ops[0 ]); -if (err) { -ceph_osdc_put_request (req); +if (err) goto out; - } }dout ("%s: pos=%llu orig_len=%zu len=%llu\n" , __func__, subreq->start, subreq->len, len);
Looks right.
Quoted 28 lines · Jeff Layton
Quoted 27 lines · On Wed, 2023-01-11 at 09:14 +0800, [email protected] wrote:
From: Xiubo Li <[email protected]>
Introduced by commit
d1f436736924("ceph: add new mount option to enable sparse reads") and will fold this into the above commit since it's still in the testing branch.Reported-by Ilya Dryomov <[email protected]>Signed-off-by Xiubo Li <[email protected]>--- fs/ceph/addr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)fs/ceph/addr.c +1
-3@@ -351,10 +351,8 @@ static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq)if (sparse) { err =ceph_alloc_sparse_ext_map (&req->r_ops[0 ]); -if (err) { -ceph_osdc_put_request (req); +if (err) goto out; - } }
Quoted 4 lines
fs/ceph/addr.c static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq) · line 358
Quoted 1 line
fs/ceph/addr.c +0
-0dout ("%s: pos=%llu orig_len=%zu len=%llu\n" , __func__, subreq->start, subreq->len, len);Looks right.
Reviewed-by Jeff Layton <[email protected]>
Already folded this into the previous commit.
Thanks Jeff.
Signature · 6 lines
Best Regards, Xiubo Li (李秀波) Email: [email protected]/[email protected] Slack: @Xiubo Li