diff mbox series

[1/7] cifs: Fix recognizing SFU symlinks

Message ID 20240912120548.15877-2-pali@kernel.org
State New
Headers show
Series cifs: Improve client SFU support for special files | expand

Commit Message

Pali Rohár Sept. 12, 2024, 12:05 p.m. UTC
SFU symlinks have 8 byte prefix: "IntxLNK\1".
So check also the last 8th byte 0x01.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 fs/smb/client/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pali Rohár Sept. 13, 2024, 8:04 p.m. UTC | #1
On Thursday 12 September 2024 14:05:42 Pali Rohár wrote:
> SFU symlinks have 8 byte prefix: "IntxLNK\1".
> So check also the last 8th byte 0x01.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>

Fixes: 9e294f1c4d4a ("[CIFS] Recognize properly symlinks and char/blk devices (not just FIFOs) created by SFU (part 2 of 2).")

(I located commit which probably by mistake removed that byte 0x01).

> ---
>  fs/smb/client/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
> index 73e2e6c230b7..7d424e769a56 100644
> --- a/fs/smb/client/inode.c
> +++ b/fs/smb/client/inode.c
> @@ -612,7 +612,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const char *path,
>  			cifs_dbg(FYI, "Socket\n");
>  			fattr->cf_mode |= S_IFSOCK;
>  			fattr->cf_dtype = DT_SOCK;
> -		} else if (memcmp("IntxLNK", pbuf, 7) == 0) {
> +		} else if (memcmp("IntxLNK\1", pbuf, 8) == 0) {
>  			cifs_dbg(FYI, "Symlink\n");
>  			fattr->cf_mode |= S_IFLNK;
>  			fattr->cf_dtype = DT_LNK;
> -- 
> 2.20.1
>
diff mbox series

Patch

diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
index 73e2e6c230b7..7d424e769a56 100644
--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -612,7 +612,7 @@  cifs_sfu_type(struct cifs_fattr *fattr, const char *path,
 			cifs_dbg(FYI, "Socket\n");
 			fattr->cf_mode |= S_IFSOCK;
 			fattr->cf_dtype = DT_SOCK;
-		} else if (memcmp("IntxLNK", pbuf, 7) == 0) {
+		} else if (memcmp("IntxLNK\1", pbuf, 8) == 0) {
 			cifs_dbg(FYI, "Symlink\n");
 			fattr->cf_mode |= S_IFLNK;
 			fattr->cf_dtype = DT_LNK;