Commit 571678e
committed
smb: client: fix race with concurrent opens in rename(2)
jira LE-4159
Rebuild_History Non-Buildable kernel-5.14.0-570.41.1.el9_6
commit-author Paulo Alcantara <pc@manguebit.org>
commit d84291f
Besides sending the rename request to the server, the rename process
also involves closing any deferred close, waiting for outstanding I/O
to complete as well as marking all existing open handles as deleted to
prevent them from deferring closes, which increases the race window
for potential concurrent opens on the target file.
Fix this by unhashing the dentry in advance to prevent any concurrent
opens on the target.
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-cifs@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
(cherry picked from commit d84291f)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>1 parent e1c8c30 commit 571678e
1 file changed
+18
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2432 | 2432 | | |
2433 | 2433 | | |
2434 | 2434 | | |
| 2435 | + | |
2435 | 2436 | | |
2436 | 2437 | | |
2437 | 2438 | | |
| |||
2447 | 2448 | | |
2448 | 2449 | | |
2449 | 2450 | | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
2450 | 2462 | | |
2451 | 2463 | | |
2452 | 2464 | | |
| |||
2486 | 2498 | | |
2487 | 2499 | | |
2488 | 2500 | | |
| 2501 | + | |
| 2502 | + | |
2489 | 2503 | | |
2490 | 2504 | | |
2491 | 2505 | | |
| |||
2544 | 2558 | | |
2545 | 2559 | | |
2546 | 2560 | | |
| 2561 | + | |
| 2562 | + | |
2547 | 2563 | | |
2548 | 2564 | | |
2549 | 2565 | | |
| |||
2553 | 2569 | | |
2554 | 2570 | | |
2555 | 2571 | | |
| 2572 | + | |
| 2573 | + | |
2556 | 2574 | | |
2557 | 2575 | | |
2558 | 2576 | | |
| |||
0 commit comments