From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wtarreau.pck.nerim.net ([62.212.114.60]:57020 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750917AbbK3Gol (ORCPT ); Mon, 30 Nov 2015 01:44:41 -0500 Date: Mon, 30 Nov 2015 07:44:33 +0100 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Olga Kornievskaia , Trond Myklebust Subject: Re: [PATCH 2.6.32 02/38] [PATCH 02/38] Failing to send a CLOSE if file is opened WRONLY and server reboots on a 4.x mount Message-ID: <20151130064433.GA31698@1wt.eu> References: <8acf8256ccc72771a80b7851061027bc@local> <20151129214702.957590241@1wt.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20151129214702.957590241@1wt.eu> Sender: stable-owner@vger.kernel.org List-ID: resending. On Sun, Nov 29, 2015 at 10:47:04PM +0100, Willy Tarreau wrote: > 2.6.32-longterm review patch. If anyone has any objections, please let me know. > > ------------------ > > 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 > Signed-off-by: Trond Myklebust > Signed-off-by: Willy Tarreau > --- > fs/nfs/nfs4state.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c > index 71ee6f6..614446b 100644 > --- a/fs/nfs/nfs4state.c > +++ b/fs/nfs/nfs4state.c > @@ -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; > } > -- > 1.7.12.2.21.g234cd45.dirty > >