diff options
author | Zefan Li <lizefan@huawei.com> | 2015-10-22 09:15:38 +0800 |
---|---|---|
committer | Zefan Li <lizefan@huawei.com> | 2015-10-22 09:15:38 +0800 |
commit | 5b2c0e733faf7bec8b1ed6bf12b2d8810cc09bc8 (patch) | |
tree | 7c4a1bcd068deaee4264fb70d53ea91d5b95de89 | |
parent | 64c646b6c0d07f6d4a0e4c4e1f01721d55e2827c (diff) | |
download | linux-3.4.y-queue-5b2c0e733faf7bec8b1ed6bf12b2d8810cc09bc8.tar.gz |
Add a fix for nfs
-rw-r--r-- | patches/failing-to-send-a-close-if-file-is-opened-wronly-and-server-reboots-on-a-4.x-mount.patch | 44 | ||||
-rw-r--r-- | patches/series | 1 |
2 files changed, 45 insertions, 0 deletions
diff --git a/patches/failing-to-send-a-close-if-file-is-opened-wronly-and-server-reboots-on-a-4.x-mount.patch b/patches/failing-to-send-a-close-if-file-is-opened-wronly-and-server-reboots-on-a-4.x-mount.patch new file mode 100644 index 0000000..9abed3d --- /dev/null +++ b/patches/failing-to-send-a-close-if-file-is-opened-wronly-and-server-reboots-on-a-4.x-mount.patch @@ -0,0 +1,44 @@ +From a41cbe86df3afbc82311a1640e20858c0cd7e065 Mon Sep 17 00:00:00 2001 +From: Olga Kornievskaia <aglo@umich.edu> +Date: Mon, 14 Sep 2015 19:54:36 -0400 +Subject: Failing to send a CLOSE if file is opened WRONLY and server reboots + on a 4.x mount +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit a41cbe86df3afbc82311a1640e20858c0cd7e065 upstream. + +A test case is as the description says: +open(foobar, O_WRONLY); +sleep() --> reboot the server +close(foobar) + +The bug is because in nfs4state.c in nfs4_reclaim_open_state() a few +line before going to restart, there is +clear_bit(NFS4CLNT_RECLAIM_NOGRACE, &state->flags). + +NFS4CLNT_RECLAIM_NOGRACE is a flag for the client states not open +owner states. Value of NFS4CLNT_RECLAIM_NOGRACE is 4 which is the +value of NFS_O_WRONLY_STATE in nfs4_state->flags. So clearing it wipes +out state and when we go to close it, “call_close” doesn’t get set as +state flag is not set and CLOSE doesn’t go on the wire. + +Signed-off-by: Olga Kornievskaia <aglo@umich.edu> +Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> +Signed-off-by: Zefan Li <lizefan@huawei.com> +--- + fs/nfs/nfs4state.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/nfs/nfs4state.c ++++ b/fs/nfs/nfs4state.c +@@ -1279,7 +1279,7 @@ restart: + } + spin_unlock(&state->state_lock); + nfs4_put_open_state(state); +- clear_bit(NFS4CLNT_RECLAIM_NOGRACE, ++ clear_bit(NFS_STATE_RECLAIM_NOGRACE, + &state->flags); + goto restart; + } diff --git a/patches/series b/patches/series index 5f72d7d..626855c 100644 --- a/patches/series +++ b/patches/series @@ -63,3 +63,4 @@ jbd2-avoid-infinite-loop-when-destroying-aborted-journal.patch ib-qib-change-lkey-table-allocation-to-support-more-mrs.patch dcache-handle-escaped-paths-in-prepend_path.patch vfs-test-for-and-handle-paths-that-are-unreachable-from-their-mnt_root.patch +failing-to-send-a-close-if-file-is-opened-wronly-and-server-reboots-on-a-4.x-mount.patch |