]> www.infradead.org Git - users/jedix/linux-maple.git/commit
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)
committerBrian Maly <brian.maly@oracle.com>
Mon, 23 Apr 2018 21:43:17 +0000 (17:43 -0400)
commit43e66cb6a09f5ded8092d9bd3a417db5ef785fc0
treee7c1ffb9f7d0c9d8c8fa84aa25eb7d6c32f88160
parentac64fc02cf81dcc7fa25ef680950c9c62bacc3a3
Failing to send a CLOSE if file is opened WRONLY and server reboots on a 4.x mount

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>
Orabug: 27848303

(cherry picked from commit a41cbe86df3afbc82311a1640e20858c0cd7e065)
Signed-off-by: Calum Mackay <calum.mackay@oracle.com>
Reviewed-by: Manjunath Patil <manjunath.b.patil@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
fs/nfs/nfs4state.c