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

Bug#1069102: linux-image-6.1.0-20-amd64 and cifs mount problem on some folders which get hidden on shares



Hi,

On Tue, Apr 16, 2024 at 05:46:33PM +0200, Salvatore Bonaccorso wrote:
> Control: tags -1 + moreinfo
> 
> Hi
> 
> 
> On Tue, Apr 16, 2024 at 02:17:49PM +0200, Manfred Larcher wrote:
> > Package: src:linux
> > Version: 6.1.85-1
> > Severity: important
> > 
> > Dear Maintainer,
> > 
> >    * What led up to the situation?
> > kernel update from version 6.1.0-18 to 6.1.0-20
> > 
> >    * What exactly did you do (or not do) that was effective (or
> >      ineffective)?
> > out system mounted a samba share via autofs (cifs) and we tried to access
> > some files and directories
> > 
> >    * What was the outcome of this action?
> > the mount point of our share is /srv/samba/shares/company and the directory
> > it/MIJ had another directory "digitale kommunikation" which did not shop up
> > on the computer which mounted the samba share. before the kernel update it
> > did and when we renamed the file to "digitale_kommunikation" or to "digitalo
> > kommunikation" we could see it.
> > in the syslog we found the following messages:
> > CIFS: VFS: directory entry name would overflow frame end of buf ...
> > we could move that direcotry into another directory and it was useable, we
> > created another directory it/abc and created the "digitale kommunikation"
> > inside and it was hidden again. after switching back to kernel 6.1.0-20
> > everything was ok.
> > upgrade to kernel 6.5.0-0.deb12.4-amd64 package was ok too.
> > 
> >    * What outcome did you expect instead?
> > we expected to just see the "digitale kommunikation" directory as before.
> 
> Can you share details on how the cifs mounts are done? Which mount
> options are used?
> 
> Were you able to find a minimal reproducing case which would help
> debug the issue on non production systems?

Can you confirm you are seeing the issue only if mounting with using
'noserverino' mount option?

Would you be in the position of building a kernel with a commit
reverted and verify the issue is gone with it?

If you follow
https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#id-1.6.6.4
with the attached patch, you should be able to get a kernel image to
test with.

Regards,
Salvatore
>From 00ab6d9874ba6adc3c8edb61c0a583e8e516ccbd Mon Sep 17 00:00:00 2001
From: Salvatore Bonaccorso <carnil@debian.org>
Date: Tue, 16 Apr 2024 22:46:24 +0200
Subject: [PATCH] Revert "smb: client: set correct d_type for reparse points
 under DFS mounts"

This reverts commit 0947d0d463d4e6fad75f3a3066613cb3d9689b26.
---
 fs/smb/client/readdir.c | 15 +++++++--------
 fs/smb/client/smb2pdu.c |  6 ------
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/fs/smb/client/readdir.c b/fs/smb/client/readdir.c
index 5990bdbae598..2d75ba5aaa8a 100644
--- a/fs/smb/client/readdir.c
+++ b/fs/smb/client/readdir.c
@@ -304,16 +304,14 @@ cifs_dir_info_to_fattr(struct cifs_fattr *fattr, FILE_DIRECTORY_INFO *info,
 }
 
 static void cifs_fulldir_info_to_fattr(struct cifs_fattr *fattr,
-				       const void *info,
+				       SEARCH_ID_FULL_DIR_INFO *info,
 				       struct cifs_sb_info *cifs_sb)
 {
-	const FILE_FULL_DIRECTORY_INFO *di = info;
-
 	__dir_info_to_fattr(fattr, info);
 
-	/* See MS-FSCC 2.4.14, 2.4.19 */
+	/* See MS-FSCC 2.4.19 FileIdFullDirectoryInformation */
 	if (fattr->cf_cifsattrs & ATTR_REPARSE)
-		fattr->cf_cifstag = le32_to_cpu(di->EaSize);
+		fattr->cf_cifstag = le32_to_cpu(info->EaSize);
 	cifs_fill_common_info(fattr, cifs_sb);
 }
 
@@ -427,7 +425,7 @@ _initiate_cifs_search(const unsigned int xid, struct file *file,
 	} else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
 		cifsFile->srch_inf.info_level = SMB_FIND_FILE_ID_FULL_DIR_INFO;
 	} else /* not srvinos - BB fixme add check for backlevel? */ {
-		cifsFile->srch_inf.info_level = SMB_FIND_FILE_FULL_DIRECTORY_INFO;
+		cifsFile->srch_inf.info_level = SMB_FIND_FILE_DIRECTORY_INFO;
 	}
 
 	search_flags = CIFS_SEARCH_CLOSE_AT_END | CIFS_SEARCH_RETURN_RESUME;
@@ -1021,9 +1019,10 @@ static int cifs_filldir(char *find_entry, struct file *file,
 				       (FIND_FILE_STANDARD_INFO *)find_entry,
 				       cifs_sb);
 		break;
-	case SMB_FIND_FILE_FULL_DIRECTORY_INFO:
 	case SMB_FIND_FILE_ID_FULL_DIR_INFO:
-		cifs_fulldir_info_to_fattr(&fattr, find_entry, cifs_sb);
+		cifs_fulldir_info_to_fattr(&fattr,
+					   (SEARCH_ID_FULL_DIR_INFO *)find_entry,
+					   cifs_sb);
 		break;
 	default:
 		cifs_dir_info_to_fattr(&fattr,
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
index cc425a616899..f95623b24405 100644
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -5010,9 +5010,6 @@ int SMB2_query_directory_init(const unsigned int xid,
 	case SMB_FIND_FILE_POSIX_INFO:
 		req->FileInformationClass = SMB_FIND_FILE_POSIX_INFO;
 		break;
-	case SMB_FIND_FILE_FULL_DIRECTORY_INFO:
-		req->FileInformationClass = FILE_FULL_DIRECTORY_INFORMATION;
-		break;
 	default:
 		cifs_tcon_dbg(VFS, "info level %u isn't supported\n",
 			info_level);
@@ -5082,9 +5079,6 @@ smb2_parse_query_directory(struct cifs_tcon *tcon,
 		/* note that posix payload are variable size */
 		info_buf_size = sizeof(struct smb2_posix_info);
 		break;
-	case SMB_FIND_FILE_FULL_DIRECTORY_INFO:
-		info_buf_size = sizeof(FILE_FULL_DIRECTORY_INFO);
-		break;
 	default:
 		cifs_tcon_dbg(VFS, "info level %u isn't supported\n",
 			 srch_inf->info_level);
-- 
2.43.0


Reply to: