Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

knfsd: eliminate unnecessary -ENOENT returns on export downcalls

A succesful downcall with a negative result (which indicates that the given
filesystem is not exported to the given user) should not return an error.

Currently mountd is depending on stdio to write these downcalls. With some
versions of libc this appears to cause subsequent writes to attempt to write
all accumulated data (for which writes previously failed) along with any new
data. This can prevent the kernel from seeing responses to later downcalls.
Symptoms will be that nfsd fails to respond to certain requests.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

J. Bruce Fields and committed by
Linus Torvalds
4a4b8831 0a725fc4

+3 -2
+3 -2
fs/nfsd/export.c
··· 564 564 565 565 /* flags */ 566 566 err = get_int(&mesg, &an_int); 567 - if (err == -ENOENT) 567 + if (err == -ENOENT) { 568 + err = 0; 568 569 set_bit(CACHE_NEGATIVE, &exp.h.flags); 569 - else { 570 + } else { 570 571 if (err || an_int < 0) goto out; 571 572 exp.ex_flags= an_int; 572 573