Skip to content

Commit d3d797e

Browse files
palismfrench
authored andcommitted
cifs: Improve guard for excluding $LXDEV xattr
$LXDEV xattr is for storing block/char device's major and minor number. Change guard which excludes storing $LXDEV xattr to explicitly filter everything except block and char device. Current guard is opposite, which is currently correct but is less-safe. This change is required for adding support for creating WSL-style symlinks as symlinks also do not use device's major and minor numbers. Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 06a7adf commit d3d797e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/smb/client/reparse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ static int wsl_set_xattrs(struct inode *inode, umode_t _mode,
378378

379379
memset(iov, 0, sizeof(*iov));
380380

381-
/* Exclude $LXDEV xattr for sockets and fifos */
382-
if (S_ISSOCK(_mode) || S_ISFIFO(_mode))
381+
/* Exclude $LXDEV xattr for non-device files */
382+
if (!S_ISBLK(_mode) && !S_ISCHR(_mode))
383383
num_xattrs = ARRAY_SIZE(xattrs) - 1;
384384
else
385385
num_xattrs = ARRAY_SIZE(xattrs);

0 commit comments

Comments
 (0)