From: NeilBrown <neilb@suse.com>
To: Trond Myklebust <trondmy@primarydata.com>
Cc: Olga Kornievskaia <aglo@umich.edu>,
Adamson William <andros@netapp.com>,
Schumaker Anna <anna.schumaker@netapp.com>,
List Linux NFS Mailing <linux-nfs@vger.kernel.org>,
Adamson@suse.com, Andy <William.Adamson@netapp.com>
Subject: [PATCH resend] NFSv4.1: nfs4_fl_prepare_ds must be careful about reporting success.
Date: Mon, 19 Dec 2016 11:19:31 +1100 [thread overview]
Message-ID: <8760mgvkh8.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <CAN-5tyFfnSxcnFjpcCqT--qQhpHa-37NnVXuX70imE1WiyFFNg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]
Various places assume that if nfs4_fl_prepare_ds() turns a non-NULL 'ds',
then ds->ds_clp will also be non-NULL.
This is not necessasrily true in the case when the process received a fatal signal
while nfs4_pnfs_ds_connect is waiting in nfs4_wait_ds_connect().
In that case ->ds_clp may not be set, and the devid may not recently have been marked
unavailable.
So add a test for ds_clp == NULL and return NULL in that case.
Fixes: c23266d532b4 ("NFS4.1 Fix data server connection race")
Signed-off-by: NeilBrown <neilb@suse.com>
Acked-by: Olga Kornievskaia <aglo@umich.edu>
Acked-by: Adamson, Andy <William.Adamson@netapp.com>
---
Hi Trond,
I just noticed that this wasn't in your 4.10 pull request. So I've
added Acked-bys from Andy and Olga and am resending.
Thanks,
NeilBrown
fs/nfs/filelayout/filelayoutdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/nfs/filelayout/filelayoutdev.c b/fs/nfs/filelayout/filelayoutdev.c
index a5589b791439..f956ca20a8a3 100644
--- a/fs/nfs/filelayout/filelayoutdev.c
+++ b/fs/nfs/filelayout/filelayoutdev.c
@@ -282,7 +282,8 @@ nfs4_fl_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx)
s->nfs_client->cl_minorversion);
out_test_devid:
- if (filelayout_test_devid_unavailable(devid))
+ if (ret->ds_clp == NULL ||
+ filelayout_test_devid_unavailable(devid))
ret = NULL;
out:
return ret;
--
2.11.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2016-12-19 0:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-21 0:01 [PATCH] NFSv4.1: nfs4_fl_prepare_ds must be careful about reporting success NeilBrown
2016-11-18 5:01 ` NeilBrown
2016-11-18 14:32 ` Trond Myklebust
2016-11-18 17:34 ` Olga Kornievskaia
2016-11-19 6:33 ` NeilBrown
2016-11-22 20:32 ` Adamson, Andy
2016-11-23 17:37 ` Olga Kornievskaia
2016-12-19 0:19 ` NeilBrown [this message]
2016-12-19 0:28 ` [PATCH resend] " Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8760mgvkh8.fsf@notabene.neil.brown.name \
--to=neilb@suse.com \
--cc=Adamson@suse.com \
--cc=William.Adamson@netapp.com \
--cc=aglo@umich.edu \
--cc=andros@netapp.com \
--cc=anna.schumaker@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trondmy@primarydata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).