* [PATCH] smb: client: report correct st_size for SMB and NFS symlinks
@ 2023-11-28 19:37 Paulo Alcantara
0 siblings, 0 replies; only message in thread
From: Paulo Alcantara @ 2023-11-28 19:37 UTC (permalink / raw)
To: smfrench; +Cc: linux-cifs, Paulo Alcantara
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.
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
---
fs/smb/client/inode.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
index 01c7d2973d66..0b05e664008e 100644
--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -866,6 +866,8 @@ static void cifs_open_info_to_fattr(struct cifs_fattr *fattr,
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;
}
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-28 19:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-28 19:37 [PATCH] smb: client: report correct st_size for SMB and NFS symlinks Paulo Alcantara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox