diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2022-03-30 10:30:54 -0400 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2022-05-23 11:06:29 -0400 |
commit | fb70bf124b051d4ded4ce57511dfec6d3ebf2b43 (patch) | |
tree | a4e26bdd2866d7671ba7b1a69ca758aba203cd88 /fs/ext4/resize.c | |
parent | f4d84c52643ae1d63a8e73e2585464470e7944d1 (diff) | |
download | linux-stable-fb70bf124b051d4ded4ce57511dfec6d3ebf2b43.tar.gz linux-stable-fb70bf124b051d4ded4ce57511dfec6d3ebf2b43.tar.bz2 linux-stable-fb70bf124b051d4ded4ce57511dfec6d3ebf2b43.zip |
NFSD: Instantiate a struct file when creating a regular NFSv4 file
There have been reports of races that cause NFSv4 OPEN(CREATE) to
return an error even though the requested file was created. NFSv4
does not provide a status code for this case.
To mitigate some of these problems, reorganize the NFSv4
OPEN(CREATE) logic to allocate resources before the file is actually
created, and open the new file while the parent directory is still
locked.
Two new APIs are added:
+ Add an API that works like nfsd_file_acquire() but does not open
the underlying file. The OPEN(CREATE) path can use this API when it
already has an open file.
+ Add an API that is kin to dentry_open(). NFSD needs to create a
file and grab an open "struct file *" atomically. The
alloc_empty_file() has to be done before the inode create. If it
fails (for example, because the NFS server has exceeded its
max_files limit), we avoid creating the file and can still return
an error to the NFS client.
BugLink: https://bugzilla.linux-nfs.org/show_bug.cgi?id=382
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: JianHong Yin <jiyin@redhat.com>
Diffstat (limited to 'fs/ext4/resize.c')
0 files changed, 0 insertions, 0 deletions