* [PATCH] bcachefs: Fix incorrect transaction handling
@ 2025-08-02 5:05 Alan Huang
2025-08-02 5:12 ` Kent Overstreet
0 siblings, 1 reply; 2+ messages in thread
From: Alan Huang @ 2025-08-02 5:05 UTC (permalink / raw)
To: kent.overstreet; +Cc: linux-bcachefs, Alan Huang, syzbot+d3fa2fb715cfcc9d201d
The ')' before the second '?:' is not correct, transaction restart
handling should include bch2_inode_hash_init_insert.
Reported-by: syzbot+d3fa2fb715cfcc9d201d@syzkaller.appspotmail.com
Signed-off-by: Alan Huang <mmpgouride@gmail.com>
---
fs/bcachefs/fs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index 3b289f696612..b5e3090f1cb8 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -511,8 +511,8 @@ struct inode *bch2_vfs_inode_get(struct bch_fs *c, subvol_inum inum)
struct bch_subvolume subvol;
int ret = lockrestart_do(trans,
bch2_subvolume_get(trans, inum.subvol, true, &subvol) ?:
- bch2_inode_find_by_inum_trans(trans, inum, &inode_u)) ?:
- PTR_ERR_OR_ZERO(inode = bch2_inode_hash_init_insert(trans, inum, &inode_u, &subvol));
+ bch2_inode_find_by_inum_trans(trans, inum, &inode_u) ?:
+ PTR_ERR_OR_ZERO(inode = bch2_inode_hash_init_insert(trans, inum, &inode_u, &subvol)));
return ret ? ERR_PTR(ret) : &inode->v;
}
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bcachefs: Fix incorrect transaction handling
2025-08-02 5:05 [PATCH] bcachefs: Fix incorrect transaction handling Alan Huang
@ 2025-08-02 5:12 ` Kent Overstreet
0 siblings, 0 replies; 2+ messages in thread
From: Kent Overstreet @ 2025-08-02 5:12 UTC (permalink / raw)
To: Alan Huang; +Cc: linux-bcachefs, syzbot+d3fa2fb715cfcc9d201d
On Sat, Aug 02, 2025 at 01:05:11PM +0800, Alan Huang wrote:
> The ')' before the second '?:' is not correct, transaction restart
> handling should include bch2_inode_hash_init_insert.
>
> Reported-by: syzbot+d3fa2fb715cfcc9d201d@syzkaller.appspotmail.com
> Signed-off-by: Alan Huang <mmpgouride@gmail.com>
hah
applied
> ---
> fs/bcachefs/fs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
> index 3b289f696612..b5e3090f1cb8 100644
> --- a/fs/bcachefs/fs.c
> +++ b/fs/bcachefs/fs.c
> @@ -511,8 +511,8 @@ struct inode *bch2_vfs_inode_get(struct bch_fs *c, subvol_inum inum)
> struct bch_subvolume subvol;
> int ret = lockrestart_do(trans,
> bch2_subvolume_get(trans, inum.subvol, true, &subvol) ?:
> - bch2_inode_find_by_inum_trans(trans, inum, &inode_u)) ?:
> - PTR_ERR_OR_ZERO(inode = bch2_inode_hash_init_insert(trans, inum, &inode_u, &subvol));
> + bch2_inode_find_by_inum_trans(trans, inum, &inode_u) ?:
> + PTR_ERR_OR_ZERO(inode = bch2_inode_hash_init_insert(trans, inum, &inode_u, &subvol)));
>
> return ret ? ERR_PTR(ret) : &inode->v;
> }
> --
> 2.49.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-02 5:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-02 5:05 [PATCH] bcachefs: Fix incorrect transaction handling Alan Huang
2025-08-02 5:12 ` Kent Overstreet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox