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 '6.3-rc5-smb3-cifs-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull cifs client fixes from Steve French:
"Two cifs/smb3 client fixes, one for stable:

- double lock fix for a cifs/smb1 reconnect path

- DFS prefixpath fix for reconnect when server moved"

* tag '6.3-rc5-smb3-cifs-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
cifs: double lock in cifs_reconnect_tcon()
cifs: sanitize paths in cifs_update_super_prepath.

+12 -8
+1 -1
fs/cifs/cifssmb.c
··· 120 120 spin_lock(&server->srv_lock); 121 121 if (server->tcpStatus == CifsNeedReconnect) { 122 122 spin_unlock(&server->srv_lock); 123 - mutex_lock(&ses->session_mutex); 123 + mutex_unlock(&ses->session_mutex); 124 124 125 125 if (tcon->retry) 126 126 goto again;
+7 -6
fs/cifs/fs_context.c
··· 441 441 * but there are some bugs that prevent rename from working if there are 442 442 * multiple delimiters. 443 443 * 444 - * Returns a sanitized duplicate of @path. The caller is responsible for 445 - * cleaning up the original. 444 + * Returns a sanitized duplicate of @path. @gfp indicates the GFP_* flags 445 + * for kstrdup. 446 + * The caller is responsible for freeing the original. 446 447 */ 447 448 #define IS_DELIM(c) ((c) == '/' || (c) == '\\') 448 - static char *sanitize_path(char *path) 449 + char *cifs_sanitize_prepath(char *prepath, gfp_t gfp) 449 450 { 450 - char *cursor1 = path, *cursor2 = path; 451 + char *cursor1 = prepath, *cursor2 = prepath; 451 452 452 453 /* skip all prepended delimiters */ 453 454 while (IS_DELIM(*cursor1)) ··· 470 469 cursor2--; 471 470 472 471 *(cursor2) = '\0'; 473 - return kstrdup(path, GFP_KERNEL); 472 + return kstrdup(prepath, gfp); 474 473 } 475 474 476 475 /* ··· 532 531 if (!*pos) 533 532 return 0; 534 533 535 - ctx->prepath = sanitize_path(pos); 534 + ctx->prepath = cifs_sanitize_prepath(pos, GFP_KERNEL); 536 535 if (!ctx->prepath) 537 536 return -ENOMEM; 538 537
+3
fs/cifs/fs_context.h
··· 287 287 */ 288 288 #define SMB3_MAX_DCLOSETIMEO (1 << 30) 289 289 #define SMB3_DEF_DCLOSETIMEO (1 * HZ) /* even 1 sec enough to help eg open/write/close/open/read */ 290 + 291 + extern char *cifs_sanitize_prepath(char *prepath, gfp_t gfp); 292 + 290 293 #endif
+1 -1
fs/cifs/misc.c
··· 1195 1195 kfree(cifs_sb->prepath); 1196 1196 1197 1197 if (prefix && *prefix) { 1198 - cifs_sb->prepath = kstrdup(prefix, GFP_ATOMIC); 1198 + cifs_sb->prepath = cifs_sanitize_prepath(prefix, GFP_ATOMIC); 1199 1199 if (!cifs_sb->prepath) 1200 1200 return -ENOMEM; 1201 1201