]> git.baikalelectronics.ru Git - kernel.git/commit
nfs: have flexfiles mirror keep creds for both ro and rw layouts
authorJeff Layton <jlayton@poochiereds.net>
Fri, 22 Apr 2016 00:52:00 +0000 (20:52 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Mon, 9 May 2016 13:05:40 +0000 (09:05 -0400)
commit64ce3845c6ff0adb39cf1b9acb6270f0ea566a4a
tree1f87f7c536b1d7520eedb35f03b85448ad3ab2ba
parent022488fad9172cb51d54fdf2edbe817812a33d58
nfs: have flexfiles mirror keep creds for both ro and rw layouts

A mirror can be shared between multiple layouts, even with different
iomodes. That makes stats gathering simpler, but it causes a problem
when we get different creds in READ vs. RW layouts.

The current code drops the newer credentials onto the floor when this
occurs. That's problematic when you fetch a READ layout first, and then
a RW. If the READ layout doesn't have the correct creds to do a write,
then writes will fail.

We could just overwrite the READ credentials with the RW ones, but that
would break the ability for the server to fence the layout for reads if
things go awry. We need to be able to revert to the earlier READ creds
if the RW layout is returned afterward.

The simplest fix is to just keep two sets of creds per mirror. One for
READ layouts and one for RW, and then use the appropriate set depending
on the iomode of the layout segment.

Also fix up some RCU nits that sparse found.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/flexfilelayout/flexfilelayout.c
fs/nfs/flexfilelayout/flexfilelayout.h
fs/nfs/flexfilelayout/flexfilelayoutdev.c