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

Pull cifs fixes from Steve French:
"Two cifs/smb3 fixes, one fscache related, and one mount parsing
related for stable"

* tag '5.16-rc5-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
cifs: sanitize multiple delimiters in prepath
cifs: ignore resource_id while getting fscache super cookie

+44 -14
+7
fs/cifs/connect.c
··· 3064 3064 (cifs_sb->ctx->rsize > server->ops->negotiate_rsize(tcon, ctx))) 3065 3065 cifs_sb->ctx->rsize = server->ops->negotiate_rsize(tcon, ctx); 3066 3066 3067 + /* 3068 + * The cookie is initialized from volume info returned above. 3069 + * Inside cifs_fscache_get_super_cookie it checks 3070 + * that we do not get super cookie twice. 3071 + */ 3072 + cifs_fscache_get_super_cookie(tcon); 3073 + 3067 3074 out: 3068 3075 mnt_ctx->server = server; 3069 3076 mnt_ctx->ses = ses;
+37 -1
fs/cifs/fs_context.c
··· 435 435 } 436 436 437 437 /* 438 + * Remove duplicate path delimiters. Windows is supposed to do that 439 + * but there are some bugs that prevent rename from working if there are 440 + * multiple delimiters. 441 + * 442 + * Returns a sanitized duplicate of @path. The caller is responsible for 443 + * cleaning up the original. 444 + */ 445 + #define IS_DELIM(c) ((c) == '/' || (c) == '\\') 446 + static char *sanitize_path(char *path) 447 + { 448 + char *cursor1 = path, *cursor2 = path; 449 + 450 + /* skip all prepended delimiters */ 451 + while (IS_DELIM(*cursor1)) 452 + cursor1++; 453 + 454 + /* copy the first letter */ 455 + *cursor2 = *cursor1; 456 + 457 + /* copy the remainder... */ 458 + while (*(cursor1++)) { 459 + /* ... skipping all duplicated delimiters */ 460 + if (IS_DELIM(*cursor1) && IS_DELIM(*cursor2)) 461 + continue; 462 + *(++cursor2) = *cursor1; 463 + } 464 + 465 + /* if the last character is a delimiter, skip it */ 466 + if (IS_DELIM(*(cursor2 - 1))) 467 + cursor2--; 468 + 469 + *(cursor2) = '\0'; 470 + return kstrdup(path, GFP_KERNEL); 471 + } 472 + 473 + /* 438 474 * Parse a devname into substrings and populate the ctx->UNC and ctx->prepath 439 475 * fields with the result. Returns 0 on success and an error otherwise 440 476 * (e.g. ENOMEM or EINVAL) ··· 529 493 if (!*pos) 530 494 return 0; 531 495 532 - ctx->prepath = kstrdup(pos, GFP_KERNEL); 496 + ctx->prepath = sanitize_path(pos); 533 497 if (!ctx->prepath) 534 498 return -ENOMEM; 535 499
-13
fs/cifs/inode.c
··· 1356 1356 goto out; 1357 1357 } 1358 1358 1359 - #ifdef CONFIG_CIFS_FSCACHE 1360 - /* populate tcon->resource_id */ 1361 - tcon->resource_id = CIFS_I(inode)->uniqueid; 1362 - #endif 1363 - 1364 1359 if (rc && tcon->pipe) { 1365 1360 cifs_dbg(FYI, "ipc connection - fake read inode\n"); 1366 1361 spin_lock(&inode->i_lock); ··· 1370 1375 iget_failed(inode); 1371 1376 inode = ERR_PTR(rc); 1372 1377 } 1373 - 1374 - /* 1375 - * The cookie is initialized from volume info returned above. 1376 - * Inside cifs_fscache_get_super_cookie it checks 1377 - * that we do not get super cookie twice. 1378 - */ 1379 - cifs_fscache_get_super_cookie(tcon); 1380 - 1381 1378 out: 1382 1379 kfree(path); 1383 1380 free_xid(xid);