nilfs2: nilfs_iget_for_gc() returns ERR_PTR
Subsystems (2)
PATCH 1/1 nilfs2: nilfs_iget_for_gc() returns ERR_PTR
nilfs_iget_for_gc() returns an ERR_PTR() on failure and doesn't return NULL.
fs/nilfs2/ioctl.c +2 -2
@@ -349,8 +349,8 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb, ino = vdesc->vd_ino; cno = vdesc->vd_cno; inode =nilfs_iget_for_gc (sb, ino, cno); -if (unlikely (inode =NULL )) { - ret = -ENOMEM ; +if (unlikely (IS_ERR (inode))) { + ret =PTR_ERR (inode); goto failed; } do {
Quoted 10 lines · Dan Carpenter
nilfs_iget_for_gc()returns anERR_PTR()on failure and doesn't return NULL.Signed-off-by Dan Carpenter <[email protected]>fs/nilfs2/ioctl.c +0
-0
fs/nilfs2/ioctl.c static int nilfs_ioctl_move_blocks(struct super_block *sb, · line 356
Quoted 10 lines
fs/nilfs2/ioctl.c +2
-2@@ -349,8 +349,8 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb, ino = vdesc->vd_ino; cno = vdesc->vd_cno; inode =nilfs_iget_for_gc (sb, ino, cno); -if (unlikely (inode =NULL )) { - ret = -ENOMEM ; +if (unlikely (IS_ERR (inode))) { + ret =PTR_ERR (inode); goto failed; } do {
Good catch!
This looks an -rc1 regression brought about by replacement of the gc iget function.
I will send this fix upstream. Thank you.
Ryusuke Konishi
Quoted 24 lines · Ryusuke Konishi
Quoted 10 lines · Dan Carpenter
nilfs_iget_for_gc()returns anERR_PTR()on failure and doesn't return NULL.Signed-off-by Dan Carpenter <[email protected]>fs/nilfs2/ioctl.c +0
-0fs/nilfs2/ioctl.c static int nilfs_ioctl_move_blocks(struct super_block *sb, · line 356
Quoted 10 lines
fs/nilfs2/ioctl.c +2
-2@@ -349,8 +349,8 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb, ino = vdesc->vd_ino; cno = vdesc->vd_cno; inode =nilfs_iget_for_gc (sb, ino, cno); -if (unlikely (inode =NULL )) { - ret = -ENOMEM ; +if (unlikely (IS_ERR (inode))) { + ret =PTR_ERR (inode); goto failed; } do {Good catch!
Quoted 6 lines
This looks an -rc1 regression brought about by replacement of the gc iget function.
I will send this fix upstream. Thank you.
Ryusuke Konishi
I'll add a minor amendment to your patch because IS_ERR() implies unlikely().
Thanks,
Ryusuke Konishi
---
From: Dan Carpenter <[email protected]>
nilfs2: nilfs_iget_for_gc() returns ERR_PTR
nilfs_iget_for_gc() returns an ERR_PTR() on failure and doesn't return NULL.
--- fs/nilfs2/ioctl.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
fs/nilfs2/ioctl.c +2 -2
@@ -349,8 +349,8 @@ static int nilfs_ioctl_move_blocks(struct super_block *sb, ino = vdesc->vd_ino; cno = vdesc->vd_cno; inode =nilfs_iget_for_gc (sb, ino, cno); -if (unlikely (inode =NULL )) { - ret = -ENOMEM ; +if (IS_ERR (inode)) { + ret =PTR_ERR (inode); goto failed; } do {
Signature · 1 line
1.7.3.2