Commit 53b9874
committed
smb: client: fix race with concurrent opens in rename(2)
JIRA: https://issues.redhat.com/browse/RHEL-108683
commit d84291f
Author: Paulo Alcantara <pc@manguebit.org>
Date: Fri Aug 8 11:43:29 2025 -0300
smb: client: fix race with concurrent opens in rename(2)
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>
Signed-off-by: Paulo Alcantara <paalcant@redhat.com>1 parent 50bfd09 commit 53b9874
1 file changed
+18
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2474 | 2474 | | |
2475 | 2475 | | |
2476 | 2476 | | |
| 2477 | + | |
2477 | 2478 | | |
2478 | 2479 | | |
2479 | 2480 | | |
| |||
2489 | 2490 | | |
2490 | 2491 | | |
2491 | 2492 | | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
2492 | 2504 | | |
2493 | 2505 | | |
2494 | 2506 | | |
| |||
2530 | 2542 | | |
2531 | 2543 | | |
2532 | 2544 | | |
| 2545 | + | |
| 2546 | + | |
2533 | 2547 | | |
2534 | 2548 | | |
2535 | 2549 | | |
| |||
2588 | 2602 | | |
2589 | 2603 | | |
2590 | 2604 | | |
| 2605 | + | |
| 2606 | + | |
2591 | 2607 | | |
2592 | 2608 | | |
2593 | 2609 | | |
2594 | 2610 | | |
2595 | 2611 | | |
2596 | 2612 | | |
| 2613 | + | |
| 2614 | + | |
2597 | 2615 | | |
2598 | 2616 | | |
2599 | 2617 | | |
| |||
0 commit comments