Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'v6.16-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:

- SMB3.1.1 POSIX extensions fix for char remapping

- Fix for repeated directory listings when directory leases enabled

- deferred close handle reuse fix

* tag 'v6.16-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
smb: improve directory cache reuse for readdir operations
smb: client: fix perf regression with deferred closes
smb: client: disable path remapping with POSIX extensions

+35 -22
+2
Documentation/admin-guide/cifs/usage.rst
··· 270 270 illegal Windows/NTFS/SMB characters to a remap range (this mount parameter 271 271 is the default for SMB3). This remap (``mapposix``) range is also 272 272 compatible with Mac (and "Services for Mac" on some older Windows). 273 + When POSIX Extensions for SMB 3.1.1 are negotiated, remapping is automatically 274 + disabled. 273 275 274 276 CIFS VFS Mount Options 275 277 ======================
+4 -4
fs/smb/client/cached_dir.h
··· 21 21 struct cached_dirents { 22 22 bool is_valid:1; 23 23 bool is_failed:1; 24 - struct dir_context *ctx; /* 25 - * Only used to make sure we only take entries 26 - * from a single context. Never dereferenced. 27 - */ 24 + struct file *file; /* 25 + * Used to associate the cache with a single 26 + * open file instance. 27 + */ 28 28 struct mutex de_mutex; 29 29 int pos; /* Expected ctx->pos */ 30 30 struct list_head entries;
+8 -2
fs/smb/client/connect.c
··· 3718 3718 goto out; 3719 3719 } 3720 3720 3721 - /* if new SMB3.11 POSIX extensions are supported do not remap / and \ */ 3722 - if (tcon->posix_extensions) 3721 + /* 3722 + * if new SMB3.11 POSIX extensions are supported, do not change anything in the 3723 + * path (i.e., do not remap / and \ and do not map any special characters) 3724 + */ 3725 + if (tcon->posix_extensions) { 3723 3726 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_POSIX_PATHS; 3727 + cifs_sb->mnt_cifs_flags &= ~(CIFS_MOUNT_MAP_SFM_CHR | 3728 + CIFS_MOUNT_MAP_SPECIAL_CHR); 3729 + } 3724 3730 3725 3731 #ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY 3726 3732 /* tell server which Unix caps we support */
+6 -3
fs/smb/client/file.c
··· 999 999 rc = cifs_get_readable_path(tcon, full_path, &cfile); 1000 1000 } 1001 1001 if (rc == 0) { 1002 - if (file->f_flags == cfile->f_flags) { 1002 + unsigned int oflags = file->f_flags & ~(O_CREAT|O_EXCL|O_TRUNC); 1003 + unsigned int cflags = cfile->f_flags & ~(O_CREAT|O_EXCL|O_TRUNC); 1004 + 1005 + if (cifs_convert_flags(oflags, 0) == cifs_convert_flags(cflags, 0) && 1006 + (oflags & (O_SYNC|O_DIRECT)) == (cflags & (O_SYNC|O_DIRECT))) { 1003 1007 file->private_data = cfile; 1004 1008 spin_lock(&CIFS_I(inode)->deferred_lock); 1005 1009 cifs_del_deferred_close(cfile); 1006 1010 spin_unlock(&CIFS_I(inode)->deferred_lock); 1007 1011 goto use_cache; 1008 - } else { 1009 - _cifsFileInfo_put(cfile, true, false); 1010 1012 } 1013 + _cifsFileInfo_put(cfile, true, false); 1011 1014 } else { 1012 1015 /* hard link on the defeered close file */ 1013 1016 rc = cifs_get_hardlink_path(tcon, inode, file);
+15 -13
fs/smb/client/readdir.c
··· 851 851 } 852 852 853 853 static void update_cached_dirents_count(struct cached_dirents *cde, 854 - struct dir_context *ctx) 854 + struct file *file) 855 855 { 856 - if (cde->ctx != ctx) 856 + if (cde->file != file) 857 857 return; 858 858 if (cde->is_valid || cde->is_failed) 859 859 return; ··· 862 862 } 863 863 864 864 static void finished_cached_dirents_count(struct cached_dirents *cde, 865 - struct dir_context *ctx) 865 + struct dir_context *ctx, struct file *file) 866 866 { 867 - if (cde->ctx != ctx) 867 + if (cde->file != file) 868 868 return; 869 869 if (cde->is_valid || cde->is_failed) 870 870 return; ··· 877 877 static void add_cached_dirent(struct cached_dirents *cde, 878 878 struct dir_context *ctx, 879 879 const char *name, int namelen, 880 - struct cifs_fattr *fattr) 880 + struct cifs_fattr *fattr, 881 + struct file *file) 881 882 { 882 883 struct cached_dirent *de; 883 884 884 - if (cde->ctx != ctx) 885 + if (cde->file != file) 885 886 return; 886 887 if (cde->is_valid || cde->is_failed) 887 888 return; ··· 912 911 static bool cifs_dir_emit(struct dir_context *ctx, 913 912 const char *name, int namelen, 914 913 struct cifs_fattr *fattr, 915 - struct cached_fid *cfid) 914 + struct cached_fid *cfid, 915 + struct file *file) 916 916 { 917 917 bool rc; 918 918 ino_t ino = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid); ··· 925 923 if (cfid) { 926 924 mutex_lock(&cfid->dirents.de_mutex); 927 925 add_cached_dirent(&cfid->dirents, ctx, name, namelen, 928 - fattr); 926 + fattr, file); 929 927 mutex_unlock(&cfid->dirents.de_mutex); 930 928 } 931 929 ··· 1025 1023 cifs_prime_dcache(file_dentry(file), &name, &fattr); 1026 1024 1027 1025 return !cifs_dir_emit(ctx, name.name, name.len, 1028 - &fattr, cfid); 1026 + &fattr, cfid, file); 1029 1027 } 1030 1028 1031 1029 ··· 1076 1074 * we need to initialize scanning and storing the 1077 1075 * directory content. 1078 1076 */ 1079 - if (ctx->pos == 0 && cfid->dirents.ctx == NULL) { 1080 - cfid->dirents.ctx = ctx; 1077 + if (ctx->pos == 0 && cfid->dirents.file == NULL) { 1078 + cfid->dirents.file = file; 1081 1079 cfid->dirents.pos = 2; 1082 1080 } 1083 1081 /* ··· 1145 1143 } else { 1146 1144 if (cfid) { 1147 1145 mutex_lock(&cfid->dirents.de_mutex); 1148 - finished_cached_dirents_count(&cfid->dirents, ctx); 1146 + finished_cached_dirents_count(&cfid->dirents, ctx, file); 1149 1147 mutex_unlock(&cfid->dirents.de_mutex); 1150 1148 } 1151 1149 cifs_dbg(FYI, "Could not find entry\n"); ··· 1186 1184 ctx->pos++; 1187 1185 if (cfid) { 1188 1186 mutex_lock(&cfid->dirents.de_mutex); 1189 - update_cached_dirents_count(&cfid->dirents, ctx); 1187 + update_cached_dirents_count(&cfid->dirents, file); 1190 1188 mutex_unlock(&cfid->dirents.de_mutex); 1191 1189 } 1192 1190