ceph: fix memory leakage in ceph_readdir
PATCH 1/1 ceph: fix memory leakage in ceph_readdir
From: Xiubo Li <[email protected]>
Signed-off-by Xiubo Li <[email protected]>
--- fs/ceph/dir.c | 1 + 1 file changed, 1 insertion(+)
fs/ceph/dir.c +1 -0
@@ -521,6 +521,7 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx) ceph_present_ino(inode->i_sb, le64_to_cpu(rde->inode.in->ino)), le32_to_cpu(rde->inode.in->mode) >> 12)) {dout ("filldir stopping us...\n" ); +ceph_mdsc_put_request (dfi->last_readdir);return 0 ; } ctx->pos++;
Signature · 1 line
2.31.1
Quoted 12 lines · On Tue, 2022-03-01 at 13:59 +0800, [email protected] wrote:
From: Xiubo Li <[email protected]>
Signed-off-by Xiubo Li <[email protected]>--- fs/ceph/dir.c | 1 + 1 file changed, 1 insertion(+)fs/ceph/dir.c +0
-0
fs/ceph/dir.c static int ceph_readdir(struct file *file, struct dir_context *ctx) · line 527
Quoted 7 lines
fs/ceph/dir.c +1
-0@@ -521,6 +521,7 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx) ceph_present_ino(inode->i_sb, le64_to_cpu(rde->inode.in->ino)), le32_to_cpu(rde->inode.in->mode) >> 12)) {dout ("filldir stopping us...\n" ); +ceph_mdsc_put_request (dfi->last_readdir);return 0 ; } ctx->pos++;
Good catch!
It looks like there is another missing put around line 482 after the note_last_dentry call. Could you fix that one up in the same patch?
Reviewed-by Jeff Layton <[email protected]>
Quoted 22 lines · Jeff Layton
Quoted 12 lines · On Tue, 2022-03-01 at 13:59 +0800, [email protected] wrote:
From: Xiubo Li <[email protected]>
Signed-off-by Xiubo Li <[email protected]>--- fs/ceph/dir.c | 1 + 1 file changed, 1 insertion(+)fs/ceph/dir.c +0
-0fs/ceph/dir.c static int ceph_readdir(struct file *file, struct dir_context *ctx) · line 527
Quoted 7 lines
fs/ceph/dir.c +1
-0@@ -521,6 +521,7 @@ static int ceph_readdir(struct file *file, struct dir_context *ctx) ceph_present_ino(inode->i_sb, le64_to_cpu(rde->inode.in->ino)), le32_to_cpu(rde->inode.in->mode) >> 12)) {dout ("filldir stopping us...\n" ); +ceph_mdsc_put_request (dfi->last_readdir);return 0 ; } ctx->pos++;Good catch!
Quoted 3 lines
It looks like there is another missing put around line 482 after the
note_last_dentrycall. Could you fix that one up in the same patch?
Sure. Will fix it.
- Xiubo
Quoted 2 lines
Reviewed-by Jeff Layton <[email protected]>