fs/ntfs3: Replace inode_trylock with inode_lock
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Thu, 30 May 2024 07:54:07 +0000 (10:54 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Wed, 26 Jun 2024 12:48:50 +0000 (15:48 +0300)
The issue was detected due to xfstest 465 failing.

Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation")
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/file.c

index 2f903b6ce15705b89bc0a06d75478e1b4d2ce270..9ae202901f3c013547e05fe9c740df35fabbea09 100644 (file)
@@ -299,10 +299,7 @@ static int ntfs_file_mmap(struct file *file, struct vm_area_struct *vma)
                }
 
                if (ni->i_valid < to) {
-                       if (!inode_trylock(inode)) {
-                               err = -EAGAIN;
-                               goto out;
-                       }
+                       inode_lock(inode);
                        err = ntfs_extend_initialized_size(file, ni,
                                                           ni->i_valid, to);
                        inode_unlock(inode);