fs/ntfs3: Fix ntfs_atomic_open
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 8 May 2023 07:26:45 +0000 (11:26 +0400)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Sun, 2 Jul 2023 20:21:24 +0000 (00:21 +0400)
This fixes xfstest 633/696.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/namei.c

index 9736b1e4a0f6f1cc44cc20b4202f84341fe6b2d9..343bce6da58a9e27c8048ef4a7003844aae5e801 100644 (file)
@@ -422,19 +422,10 @@ static int ntfs_atomic_open(struct inode *dir, struct dentry *dentry,
         * fnd contains tree's path to insert to.
         * If fnd is not NULL then dir is locked.
         */
-
-       /*
-        * Unfortunately I don't know how to get here correct 'struct nameidata *nd'
-        * or 'struct mnt_idmap *idmap'.
-        * See atomic_open in fs/namei.c.
-        * This is why xfstest/633 failed.
-        * Looks like ntfs_atomic_open must accept 'struct mnt_idmap *idmap' as argument.
-        */
-
-       inode = ntfs_create_inode(&nop_mnt_idmap, dir, dentry, uni, mode, 0,
-                                 NULL, 0, fnd);
+       inode = ntfs_create_inode(mnt_idmap(file->f_path.mnt), dir, dentry, uni,
+                                 mode, 0, NULL, 0, fnd);
        err = IS_ERR(inode) ? PTR_ERR(inode) :
-                                   finish_open(file, dentry, ntfs_file_open);
+                             finish_open(file, dentry, ntfs_file_open);
        dput(d);
 
 out2: