diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-04-09 18:06:49 -0400 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-05-11 13:14:16 +0100 |
commit | 4ce56133a793c97f5995181504ca9a16146a521f (patch) | |
tree | ef014e0dd847df4e38efafbe962c2d970bad2976 /fs/partitions/mac.h | |
parent | 205648388f15b1ccf92b09ba0cf141cdd62bf711 (diff) |
nfsd: don't fail unchecked creates of non-special files
commit 9dc4e6c4d1182d34604ea40fef641775f5b15456 upstream.
Allow a v3 unchecked open of a non-regular file succeed as if it were a
lookup; typically a client in such a case will want to fall back on a
local open, so succeeding and giving it the filehandle is more useful
than failing with nfserr_exist, which makes it appear that nothing at
all exists by that name.
Similarly for v4, on an open-create, return the same errors we would on
an attempt to open a non-regular file, instead of returning
nfserr_exist.
This fixes a problem found doing a v4 open of a symlink with
O_RDONLY|O_CREAT, which resulted in the current client returning EEXIST.
Thanks also to Trond for analysis.
Reported-by: Orion Poplawski <orion@cora.nwra.com>
Tested-by: Orion Poplawski <orion@cora.nwra.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
[bwh: Backported to 3.2: use &resfh, not resfh]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs/partitions/mac.h')
0 files changed, 0 insertions, 0 deletions