]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mountd: don't require mountpoint in crossmnt case
authorJ. Bruce Fields <bfields@citi.umich.edu>
Tue, 22 Dec 2009 18:02:08 +0000 (13:02 -0500)
committerSteve Dickson <steved@redhat.com>
Wed, 13 Jan 2010 20:39:14 +0000 (15:39 -0500)
Currently,

mount --bind /path /path

where /path is a subdirectory of a crossmnt export, can cause client
hangs, since the kernel detects that as a mountpoint, but nfs-util's
is_mountpoint() function does not.

I don't see any sure-fire way to detect such mountpoints.  But that's
OK: it's harmless to allow this upcall to succeed even when the
directory is not a mountpoint, so let's just remove this check.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
utils/mountd/cache.c

index e3403901ebf543cb58059b0cf726408a407138a7..2468bc5916084e06323341ed6aeab006378beef9 100644 (file)
@@ -619,8 +619,7 @@ static int is_subdirectory(char *subpath, char *path)
        int l = strlen(path);
 
        return strcmp(subpath, path) == 0
-               || (strncmp(subpath, path, l) == 0 && path[l] == '/'
-                   && is_mountpoint(path));
+               || (strncmp(subpath, path, l) == 0 && path[l] == '/');
 }
 
 static int path_matches(nfs_export *exp, char *path)