Commit b2c7ce1
NFS: Avoid flushing data while holding directory locks in nfs_rename()
[ Upstream commit dcd21b6 ]
The Linux client assumes that all filehandles are non-volatile for
renames within the same directory (otherwise sillyrename cannot work).
However, the existence of the Linux 'subtree_check' export option has
meant that nfs_rename() has always assumed it needs to flush writes
before attempting to rename.
Since NFSv4 does allow the client to query whether or not the server
exhibits this behaviour, and since knfsd does actually set the
appropriate flag when 'subtree_check' is enabled on an export, it
should be OK to optimise away the write flushing behaviour in the cases
where it is clearly not needed.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit af7243148f2eba8d351afbc5afbe8903a03b8945)1 parent 1066954 commit b2c7ce1
3 files changed
Lines changed: 25 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1080 | 1080 | | |
1081 | 1081 | | |
1082 | 1082 | | |
| 1083 | + | |
| 1084 | + | |
1083 | 1085 | | |
1084 | 1086 | | |
1085 | 1087 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2642 | 2642 | | |
2643 | 2643 | | |
2644 | 2644 | | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
2645 | 2657 | | |
2646 | 2658 | | |
2647 | 2659 | | |
| |||
2729 | 2741 | | |
2730 | 2742 | | |
2731 | 2743 | | |
2732 | | - | |
| 2744 | + | |
| 2745 | + | |
2733 | 2746 | | |
2734 | 2747 | | |
2735 | 2748 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
202 | 211 | | |
203 | 212 | | |
204 | 213 | | |
| |||
222 | 231 | | |
223 | 232 | | |
224 | 233 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | 234 | | |
229 | 235 | | |
230 | 236 | | |
| |||
0 commit comments