linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][SMB3 client] fix touch -h of symlink
@ 2023-10-16 17:26 Steve French
  2023-10-16 17:30 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Steve French @ 2023-10-16 17:26 UTC (permalink / raw)
  To: CIFS; +Cc: samba-technical, linux-fsdevel

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

For example:
          touch -h -t 02011200 testfile
    where testfile is a symlink would not change the timestamp, but
          touch -t 02011200 testfile
    does work to change the timestamp of the target

Looks like some symlink inode operations are missing for other fs as well

-- 
Thanks,

Steve

[-- Attachment #2: 0001-smb3-fix-touch-h-of-symlink.patch --]
[-- Type: text/x-patch, Size: 1115 bytes --]

From 6af5f835ba4987994aecbba0d7c060160c892856 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Mon, 16 Oct 2023 12:18:23 -0500
Subject: [PATCH] smb3: fix touch -h of symlink

For example:
      touch -h -t 02011200 testfile
where testfile is a symlink would not change the timestamp, but
      touch -t 02011200 testfile
does work to change the timestamp of the target

Reported-by: Micah Veilleux <micah.veilleux@iba-group.com>
Closes: https://bugzilla.samba.org/show_bug.cgi?id=14476
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/smb/client/cifsfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
index 22869cda1356..ea3a7a668b45 100644
--- a/fs/smb/client/cifsfs.c
+++ b/fs/smb/client/cifsfs.c
@@ -1191,6 +1191,7 @@ const char *cifs_get_link(struct dentry *dentry, struct inode *inode,
 
 const struct inode_operations cifs_symlink_inode_ops = {
 	.get_link = cifs_get_link,
+	.setattr = cifs_setattr,
 	.permission = cifs_permission,
 	.listxattr = cifs_listxattr,
 };
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][SMB3 client] fix touch -h of symlink
  2023-10-16 17:26 [PATCH][SMB3 client] fix touch -h of symlink Steve French
@ 2023-10-16 17:30 ` Matthew Wilcox
  2023-10-16 22:14   ` Steve French
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2023-10-16 17:30 UTC (permalink / raw)
  To: Steve French; +Cc: CIFS, samba-technical, linux-fsdevel

On Mon, Oct 16, 2023 at 12:26:23PM -0500, Steve French wrote:
> For example:
>           touch -h -t 02011200 testfile
>     where testfile is a symlink would not change the timestamp, but
>           touch -t 02011200 testfile
>     does work to change the timestamp of the target
> 
> Looks like some symlink inode operations are missing for other fs as well

Do we have an xfstests for this?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][SMB3 client] fix touch -h of symlink
  2023-10-16 17:30 ` Matthew Wilcox
@ 2023-10-16 22:14   ` Steve French
  0 siblings, 0 replies; 3+ messages in thread
From: Steve French @ 2023-10-16 22:14 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: CIFS, samba-technical, linux-fsdevel

On Mon, Oct 16, 2023 at 12:30 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Mon, Oct 16, 2023 at 12:26:23PM -0500, Steve French wrote:
> > For example:
> >           touch -h -t 02011200 testfile
> >     where testfile is a symlink would not change the timestamp, but
> >           touch -t 02011200 testfile
> >     does work to change the timestamp of the target
> >
> > Looks like some symlink inode operations are missing for other fs as well
>
> Do we have an xfstests for this?

I was thinking the same thing - would be useful to add an xfstest for
this.  I actually noticed this old bug when someone reported an
unrelated problem (where "find . -type l" doesn't show the symlink but
"ls" and "stat" do) and the other unrelated symlink bug could be
useful to add to the same test

Are there other scenarios we could repro problems to an fs that
doesn't have a .getattr method (like cifs.ko, afs) or .permission
(like nfs and ext4)?


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-16 22:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-16 17:26 [PATCH][SMB3 client] fix touch -h of symlink Steve French
2023-10-16 17:30 ` Matthew Wilcox
2023-10-16 22:14   ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).