fs/ocfs2/aops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
#syz test upstream 765e56e41a5af2d456ddda6cbd617b9d3295ab4e
Signed-off-by: Prithvi Tambewagh <activprithvi@gmail.com>
---
fs/ocfs2/aops.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 76c86f1c2b1c..586e3b74d782 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -2295,8 +2295,6 @@ static int ocfs2_dio_end_io_write(struct inode *inode,
goto out;
}
- down_write(&oi->ip_alloc_sem);
-
/* Delete orphan before acquire i_rwsem. */
if (dwc->dw_orphaned) {
BUG_ON(dwc->dw_writer_pid != task_pid_nr(current));
@@ -2309,6 +2307,8 @@ static int ocfs2_dio_end_io_write(struct inode *inode,
mlog_errno(ret);
}
+ down_write(&oi->ip_alloc_sem);
+
di = (struct ocfs2_dinode *)di_bh->b_data;
ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh);
base-commit: 765e56e41a5af2d456ddda6cbd617b9d3295ab4e
--
2.34.1
Hello, syzbot has tested the proposed patch and the reproducer did not trigger any issue: Reported-by: syzbot+78359d5fbb04318c35e9@syzkaller.appspotmail.com Tested-by: syzbot+78359d5fbb04318c35e9@syzkaller.appspotmail.com Tested on: commit: 765e56e4 Merge tag 'v6.18rc7-SMB-client-fix' of git://.. git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git console output: https://syzkaller.appspot.com/x/log.txt?x=1723be9a580000 kernel config: https://syzkaller.appspot.com/x/.config?x=38a0c4cddc846161 dashboard link: https://syzkaller.appspot.com/bug?extid=78359d5fbb04318c35e9 compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8 patch: https://syzkaller.appspot.com/x/patch.diff?x=107b8044580000 Note: testing is done by a robot and is best-effort only.
© 2016 - 2026 Red Hat, Inc.