]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ntfs: preserve RECALL_ON_OPEN on WSL special-file reparse points
authorNamjae Jeon <linkinjeon@kernel.org>
Sat, 11 Jul 2026 07:36:55 +0000 (16:36 +0900)
committerNamjae Jeon <linkinjeon@kernel.org>
Sat, 18 Jul 2026 01:10:22 +0000 (10:10 +0900)
When creating a WSL special file (socket, fifo, character or block
device), __ntfs_create() sets FILE_ATTRIBUTE_RECALL_ON_OPEN in ni->flags
as valid_reparse_data() requires for these tags. This flag is
intentionally absent from $FILE_NAME, so the subsequent reload

        ni->flags = fn->file_attributes;

drops it from ni->flags, the authoritative copy written back to
$STANDARD_INFORMATION. The on-disk file_attributes becomes 0x00000404
instead of 0x00040404, and after a remount valid_reparse_data() rejects
the reparse point while fsck reports "$REPARSE_POINT data is corrupted".

Preserve the RECALL_ON_OPEN bit across the reload. Symlinks do not set
that bit, so they are unaffected.

Fixes: af0db57d4293 ("ntfs: update inode operations")
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/ntfs/namei.c

index 5ff25e9aaa325ae0e61dcdb6c8bf47471c26ef24..cd403b1d99eed9073decc8fc3de0eb44ffb3bcc5 100644 (file)
@@ -685,7 +685,8 @@ static struct ntfs_inode *__ntfs_create(struct mnt_idmap *idmap, struct inode *d
        mutex_unlock(&dir_ni->mrec_lock);
        mutex_unlock(&ni->mrec_lock);
 
-       ni->flags = fn->file_attributes;
+       ni->flags = fn->file_attributes |
+                   (ni->flags & FILE_ATTRIBUTE_RECALL_ON_OPEN);
        /* Set the sequence number. */
        vi->i_generation = ni->seq_no;
        set_nlink(vi, 1);