All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ocfs2: bug fix when bh is null
@ 2024-09-06 22:12 Ghanshyam Agrawal
  2024-09-09  1:39 ` Su Yue
  0 siblings, 1 reply; 3+ messages in thread
From: Ghanshyam Agrawal @ 2024-09-06 22:12 UTC (permalink / raw)
  To: mark, jlbec, joseph.qi
  Cc: Ghanshyam Agrawal, ocfs2-devel, linux-kernel,
	syzbot+adfd64e93c46b99c957e

Reported-by: syzbot+adfd64e93c46b99c957e@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=adfd64e93c46b99c957e
Signed-off-by: Ghanshyam Agrawal <ghanshyam1898@gmail.com>
---
 fs/ocfs2/buffer_head_io.c | 1 -
 fs/ocfs2/uptodate.c       | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c
index cdb9b9bdea1f..e62c7e1de4eb 100644
--- a/fs/ocfs2/buffer_head_io.c
+++ b/fs/ocfs2/buffer_head_io.c
@@ -235,7 +235,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
 		if (bhs[i] == NULL) {
 			bhs[i] = sb_getblk(sb, block++);
 			if (bhs[i] == NULL) {
-				ocfs2_metadata_cache_io_unlock(ci);
 				status = -ENOMEM;
 				mlog_errno(status);
 				/* Don't forget to put previous bh! */
diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c
index 09854925fa5c..3242291402c3 100644
--- a/fs/ocfs2/uptodate.c
+++ b/fs/ocfs2/uptodate.c
@@ -471,7 +471,7 @@ void ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci,
 
 	/* The block may very well exist in our cache already, so avoid
 	 * doing any more work in that case. */
-	if (ocfs2_buffer_cached(ci, bh))
+	if (bh == NULL || ocfs2_buffer_cached(ci, bh))
 		return;
 
 	trace_ocfs2_set_buffer_uptodate_begin(
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ocfs2: bug fix when bh is null
  2024-09-06 22:12 [PATCH] ocfs2: bug fix when bh is null Ghanshyam Agrawal
@ 2024-09-09  1:39 ` Su Yue
  2024-09-09  2:27   ` Joseph Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Su Yue @ 2024-09-09  1:39 UTC (permalink / raw)
  To: Ghanshyam Agrawal
  Cc: mark, jlbec, joseph.qi, ocfs2-devel, linux-kernel,
	syzbot+adfd64e93c46b99c957e


On Sat 07 Sep 2024 at 03:42, Ghanshyam Agrawal 
<ghanshyam1898@gmail.com> wrote:

Commit message please even it's simple in one line.

> Reported-by: 
> syzbot+adfd64e93c46b99c957e@syzkaller.appspotmail.com
> Closes: 
> https://syzkaller.appspot.com/bug?extid=adfd64e93c46b99c957e
>
I think it's fixed by 
https://lore.kernel.org/ocfs2-devel/20240902023636.1843422-1-joseph.qi@linux.alibaba.com/T/#t 
.

--
Su

> Signed-off-by: Ghanshyam Agrawal <ghanshyam1898@gmail.com>
> ---
>  fs/ocfs2/buffer_head_io.c | 1 -
>  fs/ocfs2/uptodate.c       | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/ocfs2/buffer_head_io.c 
> b/fs/ocfs2/buffer_head_io.c
> index cdb9b9bdea1f..e62c7e1de4eb 100644
> --- a/fs/ocfs2/buffer_head_io.c
> +++ b/fs/ocfs2/buffer_head_io.c
> @@ -235,7 +235,6 @@ int ocfs2_read_blocks(struct 
> ocfs2_caching_info *ci, u64 block, int nr,
>  		if (bhs[i] == NULL) {
>  			bhs[i] = sb_getblk(sb, block++);
>  			if (bhs[i] == NULL) {
> -				ocfs2_metadata_cache_io_unlock(ci);
>  				status = -ENOMEM;
>  				mlog_errno(status);
>  				/* Don't forget to put previous bh! */
> diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c
> index 09854925fa5c..3242291402c3 100644
> --- a/fs/ocfs2/uptodate.c
> +++ b/fs/ocfs2/uptodate.c
> @@ -471,7 +471,7 @@ void ocfs2_set_buffer_uptodate(struct 
> ocfs2_caching_info *ci,
>
>  	/* The block may very well exist in our cache already, so 
>  avoid
>  	 * doing any more work in that case. */
> -	if (ocfs2_buffer_cached(ci, bh))
> +	if (bh == NULL || ocfs2_buffer_cached(ci, bh))
>  		return;
>
>  	trace_ocfs2_set_buffer_uptodate_begin(

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ocfs2: bug fix when bh is null
  2024-09-09  1:39 ` Su Yue
@ 2024-09-09  2:27   ` Joseph Qi
  0 siblings, 0 replies; 3+ messages in thread
From: Joseph Qi @ 2024-09-09  2:27 UTC (permalink / raw)
  To: Su Yue, Ghanshyam Agrawal
  Cc: mark, jlbec, ocfs2-devel, linux-kernel,
	syzbot+adfd64e93c46b99c957e



On 9/9/24 9:39 AM, Su Yue wrote:
> 
> On Sat 07 Sep 2024 at 03:42, Ghanshyam Agrawal <ghanshyam1898@gmail.com> wrote:
> 
> Commit message please even it's simple in one line.
> 
>> Reported-by: syzbot+adfd64e93c46b99c957e@syzkaller.appspotmail.com
>> Closes: https://syzkaller.appspot.com/bug?extid=adfd64e93c46b99c957e
>>
> I think it's fixed by https://lore.kernel.org/ocfs2-devel/20240902023636.1843422-1-joseph.qi@linux.alibaba.com/T/#t .
> 
Yes, Lizhi Xu has sent the fixes before and now it's in mm-tree.

Thanks,
Joseph

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-09  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-06 22:12 [PATCH] ocfs2: bug fix when bh is null Ghanshyam Agrawal
2024-09-09  1:39 ` Su Yue
2024-09-09  2:27   ` Joseph Qi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.