]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ntfs: fix WSL ea restore condition
authorHyunchul Lee <hyc.lee@gmail.com>
Wed, 11 Mar 2026 23:36:24 +0000 (08:36 +0900)
committerNamjae Jeon <linkinjeon@kernel.org>
Mon, 16 Mar 2026 11:27:30 +0000 (20:27 +0900)
Use NTFS_VOL_GID(not NTFS_VOL_UID) for restoring the gid, and call
ntfs_ea_get_wsl_inode() only when $EA_INFORMATION exists.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/ntfs/ea.c
fs/ntfs/inode.c

index 5b108d0ccec7b15ce027a94f948ae8ae009f68af..386eb0c5f303dec6e20362edd09f58afb029914c 100644 (file)
@@ -368,7 +368,7 @@ int ntfs_ea_get_wsl_inode(struct inode *inode, dev_t *rdevp, unsigned int flags)
                i_uid_write(inode, le32_to_cpu(v));
        }
 
-       if (!(flags & NTFS_VOL_UID)) {
+       if (!(flags & NTFS_VOL_GID)) {
                /* Load gid to lxgid EA */
                err = ntfs_get_ea(inode, "$LXGID", sizeof("$LXGID") - 1, &v,
                                sizeof(v));
index 43d7ecc14c150e19961c244f7f6612a0990efef6..7547174a99ae02470a426befc55533251be1a6cc 100644 (file)
@@ -865,10 +865,10 @@ static int ntfs_read_locked_inode(struct inode *vi)
        }
 skip_attr_list_load:
        err = ntfs_attr_lookup(AT_EA_INFORMATION, NULL, 0, 0, 0, NULL, 0, ctx);
-       if (!err)
+       if (!err) {
                NInoSetHasEA(ni);
-
-       ntfs_ea_get_wsl_inode(vi, &dev, flags);
+               ntfs_ea_get_wsl_inode(vi, &dev, flags);
+       }
 
        if (m->flags & MFT_RECORD_IS_DIRECTORY) {
                vi->i_mode |= S_IFDIR;