linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFSv4.1: Work around a Linux server bug...
@ 2017-05-09 19:53 Trond Myklebust
  2017-05-09 19:56 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Trond Myklebust @ 2017-05-09 19:53 UTC (permalink / raw)
  To: Anna Schumaker; +Cc: linux-nfs

It turns out the Linux server has a bug in its implementation of
supattr_exclcreat; it returns the set of all attributes, whether
or not they are supported by minor version 1.
In order to avoid a regression, we therefore apply the supported_attrs
as a mask on top of whatever the server sent us.

Reported-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfs/nfs4proc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f48dfb7f3691..c08c46a3b8cd 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3268,6 +3268,7 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
 		.rpc_resp = &res,
 	};
 	int status;
+	int i;
 
 	bitmask[0] = FATTR4_WORD0_SUPPORTED_ATTRS |
 		     FATTR4_WORD0_FH_EXPIRE_TYPE |
@@ -3333,8 +3334,13 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
 		server->cache_consistency_bitmask[0] &= FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE;
 		server->cache_consistency_bitmask[1] &= FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY;
 		server->cache_consistency_bitmask[2] = 0;
+
+		/* Avoid a regression due to buggy server */
+		for (i = 0; i < ARRAY_SIZE(res.exclcreat_bitmask); i++)
+			res.exclcreat_bitmask[i] &= res.attr_bitmask[i];
 		memcpy(server->exclcreat_bitmask, res.exclcreat_bitmask,
 			sizeof(server->exclcreat_bitmask));
+
 		server->acl_bitmask = res.acl_bitmask;
 		server->fh_expire_type = res.fh_expire_type;
 	}
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] NFSv4.1: Work around a Linux server bug...
  2017-05-09 19:53 [PATCH] NFSv4.1: Work around a Linux server bug Trond Myklebust
@ 2017-05-09 19:56 ` Christoph Hellwig
  2017-05-09 19:58   ` Trond Myklebust
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2017-05-09 19:56 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Anna Schumaker, linux-nfs

On Tue, May 09, 2017 at 03:53:35PM -0400, Trond Myklebust wrote:
> It turns out the Linux server has a bug in its implementation of
> supattr_exclcreat; it returns the set of all attributes, whether
> or not they are supported by minor version 1.

Are you going to send a fix?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] NFSv4.1: Work around a Linux server bug...
  2017-05-09 19:56 ` Christoph Hellwig
@ 2017-05-09 19:58   ` Trond Myklebust
  0 siblings, 0 replies; 3+ messages in thread
From: Trond Myklebust @ 2017-05-09 19:58 UTC (permalink / raw)
  To: hch@infradead.org; +Cc: Anna.Schumaker@Netapp.com, linux-nfs@vger.kernel.org

T24gVHVlLCAyMDE3LTA1LTA5IGF0IDEyOjU2IC0wNzAwLCBDaHJpc3RvcGggSGVsbHdpZyB3cm90
ZToNCj4gT24gVHVlLCBNYXkgMDksIDIwMTcgYXQgMDM6NTM6MzVQTSAtMDQwMCwgVHJvbmQgTXlr
bGVidXN0IHdyb3RlOg0KPiA+IEl0IHR1cm5zIG91dCB0aGUgTGludXggc2VydmVyIGhhcyBhIGJ1
ZyBpbiBpdHMgaW1wbGVtZW50YXRpb24gb2YNCj4gPiBzdXBhdHRyX2V4Y2xjcmVhdDsgaXQgcmV0
dXJucyB0aGUgc2V0IG9mIGFsbCBhdHRyaWJ1dGVzLCB3aGV0aGVyDQo+ID4gb3Igbm90IHRoZXkg
YXJlIHN1cHBvcnRlZCBieSBtaW5vciB2ZXJzaW9uIDEuDQo+IA0KPiBBcmUgeW91IGdvaW5nIHRv
IHNlbmQgYSBmaXg/DQo+IA0KDQpZZXMuIEdpdmUgbWUgYSBmZXcgbW9yZSBtb21lbnRzLi4uIOKY
ug0KDQpUaGUgZXhhY3Qgc2FtZSBmaXggbmVlZHMgdG8gYmUgYXBwbGllZCBvbiB0aGUgc2VydmVy
IHNpZGUuDQotLSANClRyb25kIE15a2xlYnVzdA0KTGludXggTkZTIGNsaWVudCBtYWludGFpbmVy
LCBQcmltYXJ5RGF0YQ0KdHJvbmQubXlrbGVidXN0QHByaW1hcnlkYXRhLmNvbQ0K


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-09 19:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-09 19:53 [PATCH] NFSv4.1: Work around a Linux server bug Trond Myklebust
2017-05-09 19:56 ` Christoph Hellwig
2017-05-09 19:58   ` Trond Myklebust

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).