Commit 268d92c
CKI KWF Bot
Merge: vfs: fix copy_file_range() averts filesystem freeze protection
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7429
vfs: fix copy_file_range() averts filesystem freeze protection
JIRA: https://issues.redhat.com/browse/RHEL-76048
Conflicts:
- Dropping fs/ksmbd hunk as we don't have this in RHEL
- RHEL also does not have the work to "Tidy up file permission hooks":
https://lore.kernel.org/all/20231122122715.2561213-1-amir73il@gmail.com/
so this patch drops the upstream hunk for lockdep_assert() check for the
superblock's s_writers.rw_sem, which would cause a build problem for
RHEL debug kernels.
commit 10bc8e4
Author: Amir Goldstein <amir73il@gmail.com>
Date: Thu Nov 17 22:52:49 2022 +0200
vfs: fix copy_file_range() averts filesystem freeze protection
Commit 868f9f2 ("vfs: fix copy_file_range() regression in cross-fs
copies") removed fallback to generic_copy_file_range() for cross-fs
cases inside vfs_copy_file_range().
To preserve behavior of nfsd and ksmbd server-side-copy, the fallback to
generic_copy_file_range() was added in nfsd and ksmbd code, but that
call is missing sb_start_write(), fsnotify hooks and more.
Ideally, nfsd and ksmbd would pass a flag to vfs_copy_file_range() that
will take care of the fallback, but that code would be subtle and we got
vfs_copy_file_range() logic wrong too many times already.
Instead, add a flag to explicitly request vfs_copy_file_range() to
perform only generic_copy_file_range() and let nfsd and ksmbd use this
flag only in the fallback path.
This choise keeps the logic changes to minimum in the non-nfsd/ksmbd code
paths to reduce the risk of further regressions.
Fixes: 868f9f2 ("vfs: fix copy_file_range() regression in cross-fs copies")
Tested-by: Namjae Jeon <linkinjeon@kernel.org>
Tested-by: Luis Henriques <lhenriques@suse.de>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Approved-by: Jay Shin <jaeshin@redhat.com>
Approved-by: Scott Mayhew <smayhew@redhat.com>
Approved-by: Olga Kornievskaia <okorniev@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>
Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>3 files changed
+23
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
712 | | - | |
713 | | - | |
| 712 | + | |
| 713 | + | |
714 | 714 | | |
715 | 715 | | |
716 | 716 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1420 | 1420 | | |
1421 | 1421 | | |
1422 | 1422 | | |
1423 | | - | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
1424 | 1426 | | |
1425 | 1427 | | |
1426 | 1428 | | |
| |||
1470 | 1472 | | |
1471 | 1473 | | |
1472 | 1474 | | |
| 1475 | + | |
1473 | 1476 | | |
1474 | | - | |
| 1477 | + | |
1475 | 1478 | | |
1476 | 1479 | | |
1477 | 1480 | | |
| |||
1497 | 1500 | | |
1498 | 1501 | | |
1499 | 1502 | | |
1500 | | - | |
| 1503 | + | |
1501 | 1504 | | |
1502 | 1505 | | |
1503 | 1506 | | |
1504 | 1507 | | |
1505 | 1508 | | |
1506 | 1509 | | |
1507 | | - | |
| 1510 | + | |
1508 | 1511 | | |
1509 | 1512 | | |
1510 | 1513 | | |
| |||
1524 | 1527 | | |
1525 | 1528 | | |
1526 | 1529 | | |
| 1530 | + | |
| 1531 | + | |
1527 | 1532 | | |
1528 | 1533 | | |
1529 | 1534 | | |
| |||
1578 | 1583 | | |
1579 | 1584 | | |
1580 | 1585 | | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
1581 | 1590 | | |
1582 | 1591 | | |
1583 | 1592 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1907 | 1907 | | |
1908 | 1908 | | |
1909 | 1909 | | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
1910 | 1918 | | |
1911 | 1919 | | |
1912 | 1920 | | |
| |||
0 commit comments