NeilBrown 39f897fdbd NFSv4: When returning a delegation, don't reclaim an incompatible open mode.
It is possible to have an active open with one mode, and a delegation
for the same file with a different mode.
In particular, a WR_ONLY open and an RD_ONLY delegation.
This happens if a WR_ONLY open is followed by a RD_ONLY open which
provides a delegation, but is then close.

When returning the delegation, we currently try to claim opens for
every open type (n_rdwr, n_rdonly, n_wronly).  As there is no harm
in claiming an open for a mode that we already have, this is often
simplest.

However if the delegation only provides a subset of the modes that we
currently have open, this will produce an error from the server.

So when claiming open modes prior to returning a delegation, skip the
open request if the mode is not covered by the delegation - the open_stateid
must already cover that mode, so there is nothing to do.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-06-29 09:17:13 -04:00
..
2013-06-08 16:20:18 -04:00
2015-04-23 15:16:27 -04:00
2015-04-26 17:33:59 -07:00
2015-04-26 17:33:59 -07:00
2015-04-23 15:16:14 -04:00
2012-07-30 19:06:41 -04:00
2015-02-03 11:06:34 -08:00
2015-04-26 17:33:59 -07:00
2015-06-02 08:55:28 -04:00
2015-04-23 15:16:14 -04:00
2015-04-23 15:16:14 -04:00
2012-07-30 19:06:52 -04:00
2015-01-30 20:43:30 -05:00
2015-04-23 15:16:27 -04:00
2015-04-26 17:33:59 -07:00
2015-04-26 17:33:59 -07:00
2015-06-22 09:55:08 -04:00