diff mbox series

[1/3] export: fix handling of error from match_fsid()

Message ID 20231011051131.24667-2-neilb@suse.de (mailing list archive)
State New, archived
Headers show
Series fixes for error handling in nfsd_fh | expand

Commit Message

NeilBrown Oct. 11, 2023, 4:58 a.m. UTC
If match_fsid() returns -1 we shouldn't assume that the path definitely
doesn't match the fsid, though it might not.
This is a similar situation to where an export is expected to be a mount
point, but is found not to be one.  So it can be handled the same way,
by setting 'dev_missing'.
This will only have an effect is no other path matched the fsid, which
is what we want.

The current code results in nothing being exported and any export point,
or any mount point beneath a crossmnt export point fail a 'stat'
request, which is too harsh.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 support/export/cache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/support/export/cache.c b/support/export/cache.c
index 19bbba556060..e4595020f43f 100644
--- a/support/export/cache.c
+++ b/support/export/cache.c
@@ -858,7 +858,8 @@  static void nfsd_fh(int f)
 			case 0:
 				continue;
 			case -1:
-				goto out;
+				dev_missing ++;
+				continue;
 			}
 			if (is_ipaddr_client(dom)
 					&& !ipaddr_client_matches(exp, ai))