erofs: fix error return code in erofs_fscache_meta_read_folio and erofs_fscache_read_folio
Subsystems (2)
PATCH 1/1 erofs: fix error return code in erofs_fscache_meta_read_folio and erofs_fscache_read_folio
If erofs_fscache_alloc_request fail and then goto out, it will return 0. it should return a negative error code instead of 0.
--- fs/erofs/fscache.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
fs/erofs/fscache.c +6 -2
@@ -222,8 +222,10 @@ static int erofs_fscache_meta_read_folio(struct file *data, struct folio *folio) rreq =erofs_fscache_alloc_request (folio_mapping (folio),folio_pos (folio),folio_size (folio)); -if (IS_ERR (rreq)) +if (IS_ERR (rreq)) { + ret =PTR_ERR (rreq); goto out; + }return erofs_fscache_read_folios_async (mdev.m_fscache->cookie, rreq, mdev.m_pa);
@@ -301,8 +303,10 @@ static int erofs_fscache_read_folio(struct file *file, struct folio *folio) rreq =erofs_fscache_alloc_request (folio_mapping (folio),folio_pos (folio),folio_size (folio)); -if (IS_ERR (rreq)) +if (IS_ERR (rreq)) { + ret =PTR_ERR (rreq); goto out_unlock; + } pstart = mdev.m_pa + (pos - map.m_la); return erofs_fscache_read_folios_async(mdev.m_fscache->cookie,
Signature · 1 line
2.31.1
Quoted 5 lines · Sun Ke
If
erofs_fscache_alloc_requestfail and then goto out, it will return 0. it should return a negative error code instead of 0.Fixes d435d53228dd ("erofs: change to use asynchronous io for fscache readpage/readahead")Signed-off-by Sun Ke <[email protected]>
Thanks for the catch! Looks good to me,
Thanks,
Gao Xiang
Quoted 34 lines
--- fs/erofs/fscache.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)fs/erofs/fscache.c +6
-2@@ -222,8 +222,10 @@ static int erofs_fscache_meta_read_folio(struct file *data, struct folio *folio) rreq =erofs_fscache_alloc_request (folio_mapping (folio),folio_pos (folio),folio_size (folio)); -if (IS_ERR (rreq)) +if (IS_ERR (rreq)) { + ret =PTR_ERR (rreq); goto out; + }return erofs_fscache_read_folios_async (mdev.m_fscache->cookie, rreq, mdev.m_pa);@@ -301,8 +303,10 @@ static int erofs_fscache_read_folio(struct file *file, struct folio *folio) rreq =erofs_fscache_alloc_request (folio_mapping (folio),folio_pos (folio),folio_size (folio)); -if (IS_ERR (rreq)) +if (IS_ERR (rreq)) { + ret =PTR_ERR (rreq); goto out_unlock; + } pstart = mdev.m_pa + (pos - map.m_la); return erofs_fscache_read_folios_async(mdev.m_fscache->cookie,Signature · 1 line
2.31.1
Quoted 5 lines · Sun Ke via Linux-erofs
If
erofs_fscache_alloc_requestfail and then goto out, it will return 0. it should return a negative error code instead of 0.Fixes d435d53228dd ("erofs: change to use asynchronous io for fscache readpage/readahead")Signed-off-by Sun Ke <[email protected]>
LGTM.
Quoted 32 lines
--- fs/erofs/fscache.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)fs/erofs/fscache.c +6
-2@@ -222,8 +222,10 @@ static int erofs_fscache_meta_read_folio(struct file *data, struct folio *folio) rreq =erofs_fscache_alloc_request (folio_mapping (folio),folio_pos (folio),folio_size (folio)); -if (IS_ERR (rreq)) +if (IS_ERR (rreq)) { + ret =PTR_ERR (rreq); goto out; + }return erofs_fscache_read_folios_async (mdev.m_fscache->cookie, rreq, mdev.m_pa);@@ -301,8 +303,10 @@ static int erofs_fscache_read_folio(struct file *file, struct folio *folio) rreq =erofs_fscache_alloc_request (folio_mapping (folio),folio_pos (folio),folio_size (folio)); -if (IS_ERR (rreq)) +if (IS_ERR (rreq)) { + ret =PTR_ERR (rreq); goto out_unlock; + } pstart = mdev.m_pa + (pos - map.m_la); return erofs_fscache_read_folios_async(mdev.m_fscache->cookie,
Signature · 2 lines
Thanks, Jingbo
Quoted 5 lines · Sun Ke
If
erofs_fscache_alloc_requestfail and then goto out, it will return 0. it should return a negative error code instead of 0.Fixes d435d53228dd ("erofs: change to use asynchronous io for fscache readpage/readahead")Signed-off-by Sun Ke <[email protected]>
Minor, I tried to apply this patch by updating the patch title into "erofs: fix error return code in erofs_fscache_{meta_,}read_folio"
since the original patch title is too long.
Thanks,
Gao Xiang
Quoted 11 lines · Gao Xiang
Quoted 5 lines · Sun Ke
If
erofs_fscache_alloc_requestfail and then goto out, it will return 0. it should return a negative error code instead of 0.Fixes d435d53228dd ("erofs: change to use asynchronous io for fscache readpage/readahead")Signed-off-by Sun Ke <[email protected]>Minor, I tried to apply this patch by updating the patch title into "erofs: fix error return code in erofs_fscache_{meta_,}read_folio"
since the original patch title is too long.
Should I send a v2 patch to update the title?
Thanks,
Sun Ke
Quoted 5 lines
Thanks,
Gao Xiang
.
Hi Ke,
Quoted 10 lines · Sun Ke
Quoted 7 lines · Gao Xiang
Quoted 5 lines · Sun Ke
If
erofs_fscache_alloc_requestfail and then goto out, it will return 0. it should return a negative error code instead of 0.Fixes d435d53228dd ("erofs: change to use asynchronous io for fscache readpage/readahead")Signed-off-by Sun Ke <[email protected]>
Quoted 6 lines
Quoted 4 lines
Minor, I tried to apply this patch by updating the patch title into "erofs: fix error return code in erofs_fscache_{meta_,}read_folio"
since the original patch title is too long.
Should I send a v2 patch to update the title?
I've already updated this by hand if you have no concern ;) will push out to -next today...
Thanks,
Gao Xiang
Quoted 8 lines
Thanks,
Sun KeQuoted 5 lines
Thanks,
Gao Xiang
.
Quoted 16 lines · Gao Xiang
Hi Ke,
Quoted 13 lines · Sun Ke
Quoted 10 lines · Gao Xiang
Quoted 5 lines · Sun Ke
If
erofs_fscache_alloc_requestfail and then goto out, it will return 0. it should return a negative error code instead of 0.Fixes d435d53228dd ("erofs: change to use asynchronous io for fscache readpage/readahead")Signed-off-by Sun Ke <[email protected]>Minor, I tried to apply this patch by updating the patch title into "erofs: fix error return code in erofs_fscache_{meta_,}read_folio"
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
since the original patch title is too long.
Should I send a v2 patch to update the title?
I've already updated this by hand if you have no concern ;) will push out to -next today...
;)
Thanks,
Sun Ke
Quoted 14 lines
Thanks,
Gao XiangQuoted 8 lines
Thanks,
Sun KeQuoted 5 lines
Thanks,
Gao Xiang
..
Quoted 5 lines · Sun Ke
If
erofs_fscache_alloc_requestfail and then goto out, it will return 0. it should return a negative error code instead of 0.Fixes d435d53228dd ("erofs: change to use asynchronous io for fscache readpage/readahead")Signed-off-by Sun Ke <[email protected]>
Thanks,