]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Failing to send a CLOSE if file is opened WRONLY and server reboots on a 4.x mount
authorOlga Kornievskaia <aglo@umich.edu>
Mon, 14 Sep 2015 23:54:36 +0000 (19:54 -0400)
committerWilly Tarreau <w@1wt.eu>
Sat, 5 Dec 2015 23:49:01 +0000 (00:49 +0100)
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, â\80\9ccall_closeâ\80\9d doesnâ\80\99t get set as
state flag is not set and CLOSE doesnâ\80\99t go on the wire.

Signed-off-by: Olga Kornievskaia <aglo@umich.edu>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/nfs/nfs4state.c

index 71ee6f609d5c4df04b215111d602a5acebe7e470..614446b2a9dcd669f1d8f8cf194018ab913c3423 100644 (file)
@@ -929,7 +929,7 @@ restart:
                                                        __func__);
                                }
                                nfs4_put_open_state(state);
-                               clear_bit(NFS4CLNT_RECLAIM_NOGRACE,
+                               clear_bit(NFS_STATE_RECLAIM_NOGRACE,
                                        &state->flags);
                                goto restart;
                        }