Patch "smb: client: report correct st_size for SMB and NFS symlinks" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    smb: client: report correct st_size for SMB and NFS symlinks

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     smb-client-report-correct-st_size-for-smb-and-nfs-symlinks.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 9d63509547a940225d06d7eba1dc412befae255d Mon Sep 17 00:00:00 2001
From: Paulo Alcantara <pc@xxxxxxxxxxxxx>
Date: Tue, 28 Nov 2023 16:37:19 -0300
Subject: smb: client: report correct st_size for SMB and NFS symlinks

From: Paulo Alcantara <pc@xxxxxxxxxxxxx>

commit 9d63509547a940225d06d7eba1dc412befae255d upstream.

We can't rely on FILE_STANDARD_INFORMATION::EndOfFile for reparse
points as they will be always zero.  Set it to symlink target's length
as specified by POSIX.

This will make stat() family of syscalls return the correct st_size
for such files.

Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Paulo Alcantara (SUSE) <pc@xxxxxxxxxxxxx>
Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/smb/client/inode.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -823,6 +823,8 @@ static void cifs_open_info_to_fattr(stru
 
 out_reparse:
 	if (S_ISLNK(fattr->cf_mode)) {
+		if (likely(data->symlink_target))
+			fattr->cf_eof = strnlen(data->symlink_target, PATH_MAX);
 		fattr->cf_symlink_target = data->symlink_target;
 		data->symlink_target = NULL;
 	}


Patches currently in stable-queue which might be from pc@xxxxxxxxxxxxx are

queue-6.6/cifs-fix-falloc_fl_zero_range-by-setting-i_size-if-eof-moved.patch
queue-6.6/cifs-fix-falloc_fl_insert_range-by-setting-i_size-after-eof-moved.patch
queue-6.6/smb-client-report-correct-st_size-for-smb-and-nfs-symlinks.patch
queue-6.6/smb-client-fix-missing-mode-bits-for-smb-symlinks.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux