diff options
author | NeilBrown <neilb@suse.com> | 2015-07-30 13:00:56 +1000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2015-10-13 03:46:05 +0100 |
commit | 090e974e340408eaa8d42afe3bb2016be8f3523e (patch) | |
tree | 287341c6b1750be0605beb48043b3e9df00ef800 /include | |
parent | 48c46d4aed1c27f363e4673e988212340e82e1bb (diff) | |
download | kernel_samsung_smdk4412-090e974e340408eaa8d42afe3bb2016be8f3523e.zip kernel_samsung_smdk4412-090e974e340408eaa8d42afe3bb2016be8f3523e.tar.gz kernel_samsung_smdk4412-090e974e340408eaa8d42afe3bb2016be8f3523e.tar.bz2 |
NFSv4: don't set SETATTR for O_RDONLY|O_EXCL
commit efcbc04e16dfa95fef76309f89710dd1d99a5453 upstream.
It is unusual to combine the open flags O_RDONLY and O_EXCL, but
it appears that libre-office does just that.
[pid 3250] stat("/home/USER/.config", {st_mode=S_IFDIR|0700, st_size=8192, ...}) = 0
[pid 3250] open("/home/USER/.config/libreoffice/4-suse/user/extensions/buildid", O_RDONLY|O_EXCL <unfinished ...>
NFSv4 takes O_EXCL as a sign that a setattr command should be sent,
probably to reset the timestamps.
When it was an O_RDONLY open, the SETATTR command does not
identify any actual attributes to change.
If no delegation was provided to the open, the SETATTR uses the
all-zeros stateid and the request is accepted (at least by the
Linux NFS server - no harm, no foul).
If a read-delegation was provided, this is used in the SETATTR
request, and a Netapp filer will justifiably claim
NFS4ERR_BAD_STATEID, which the Linux client takes as a sign
to retry - indefinitely.
So only treat O_EXCL specially if O_CREAT was also given.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
[bwh: Backported to 3.2: we only check open_flags, not createmode as well]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions