diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2022-08-13 08:22:25 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2022-08-13 13:02:13 -0400 |
commit | 67f4b5dc49913abcdb5cc736e73674e2f352f81d (patch) | |
tree | 1c0ebf97a99d915ebd983c2f4dd04217d8b9d7af /fs/nfs/pnfs_dev.c | |
parent | 2067231a9e2cbbcae0a4aca6ac36ff2dd6a7b701 (diff) | |
download | linux-67f4b5dc49913abcdb5cc736e73674e2f352f81d.tar.gz linux-67f4b5dc49913abcdb5cc736e73674e2f352f81d.tar.bz2 linux-67f4b5dc49913abcdb5cc736e73674e2f352f81d.zip |
NFS: Fix another fsync() issue after a server reboot
Currently, when the writeback code detects a server reboot, it redirties
any pages that were not committed to disk, and it sets the flag
NFS_CONTEXT_RESEND_WRITES in the nfs_open_context of the file descriptor
that dirtied the file. While this allows the file descriptor in question
to redrive its own writes, it violates the fsync() requirement that we
should be synchronising all writes to disk.
While the problem is infrequent, we do see corner cases where an
untimely server reboot causes the fsync() call to abandon its attempt to
sync data to disk and causing data corruption issues due to missed error
conditions or similar.
In order to tighted up the client's ability to deal with this situation
without introducing livelocks, add a counter that records the number of
times pages are redirtied due to a server reboot-like condition, and use
that in fsync() to redrive the sync to disk.
Fixes: 2197e9b06c22 ("NFS: Fix up fsync() when the server rebooted")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/pnfs_dev.c')
0 files changed, 0 insertions, 0 deletions