Skip to content

Commit a49f0ab

Browse files
Revert "fs/ntfs3: Replace inode_trylock with inode_lock"
This reverts commit 69505fe. Initially, conditional lock acquisition was removed to fix an xfstest bug that was observed during internal testing. The deadlock reported by syzbot is resolved by reintroducing conditional acquisition. The xfstest bug no longer occurs on kernel version 6.16-rc1 during internal testing. I assume that changes in other modules may have contributed to this. Fixes: 69505fe ("fs/ntfs3: Replace inode_trylock with inode_lock") Reported-by: syzbot+a91fcdbd2698f99db8f4@syzkaller.appspotmail.com Suggested-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent 519b078 commit a49f0ab

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

fs/ntfs3/file.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,10 @@ static int ntfs_file_mmap(struct file *file, struct vm_area_struct *vma)
322322
}
323323

324324
if (ni->i_valid < to) {
325-
inode_lock(inode);
325+
if (!inode_trylock(inode)) {
326+
err = -EAGAIN;
327+
goto out;
328+
}
326329
err = ntfs_extend_initialized_size(file, ni,
327330
ni->i_valid, to);
328331
inode_unlock(inode);

0 commit comments

Comments
 (0)