Skip to content

Commit 2ec08ea

Browse files
hclee1Naim
authored andcommitted
ntfs: fix WSL ea restore condition
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>
1 parent 6f59856 commit 2ec08ea

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

fs/ntfs/ea.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ int ntfs_ea_get_wsl_inode(struct inode *inode, dev_t *rdevp, unsigned int flags)
368368
i_uid_write(inode, le32_to_cpu(v));
369369
}
370370

371-
if (!(flags & NTFS_VOL_UID)) {
371+
if (!(flags & NTFS_VOL_GID)) {
372372
/* Load gid to lxgid EA */
373373
err = ntfs_get_ea(inode, "$LXGID", sizeof("$LXGID") - 1, &v,
374374
sizeof(v));

fs/ntfs/inode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,10 +865,10 @@ static int ntfs_read_locked_inode(struct inode *vi)
865865
}
866866
skip_attr_list_load:
867867
err = ntfs_attr_lookup(AT_EA_INFORMATION, NULL, 0, 0, 0, NULL, 0, ctx);
868-
if (!err)
868+
if (!err) {
869869
NInoSetHasEA(ni);
870-
871-
ntfs_ea_get_wsl_inode(vi, &dev, flags);
870+
ntfs_ea_get_wsl_inode(vi, &dev, flags);
871+
}
872872

873873
if (m->flags & MFT_RECORD_IS_DIRECTORY) {
874874
vi->i_mode |= S_IFDIR;

0 commit comments

Comments
 (0)