Bug 219738
Summary: | generic/647 and generic/729 fail when attribute delegation is enabled | ||
---|---|---|---|
Product: | File System | Reporter: | Chuck Lever (chuck.lever) |
Component: | NFS | Assignee: | Trond Myklebust (trondmy) |
Status: | NEW --- | ||
Severity: | normal | CC: | chuck.lever |
Priority: | P3 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | Subsystem: | ||
Regression: | No | Bisected commit-id: |
Description
Chuck Lever
2025-01-31 14:39:54 UTC
The mmap-rw-fault program truncates a test file, then writes the file with O_DIRECT, and then reads from that file using mmap. After writing the file and closing it, the mmap fails with EFAULT because the cached file size on the client is still zero. This is because, upon completion of the direct WRITE, nfs_writeback_update_inode() skips the file size update if an attribute delegation is present. The mmap-rw-fault program opens and closes the test program repeatedly. Every other open specifies the O_DIRECT flag. However the Linux NFS client caches open and delegation state IDs after the application closes. For the O_DIRECT WRITEs, the client uses the cached delegation state ID, and that state ID is what quashes the file size update (when it represents an attribute delegation). NFSv4.1 also uses a delegation state ID in this case, but because it does not represent an attribute delegation, nfs_writeback_update_inode() updates the file size appropriately. NFSv4.2 OPEN_XOR_DELEG makes this problem worse because in that case, there is no cached OPEN state ID for the direct I/O to fall back on. |