2008-01-31 19:23:55

by Frank Filz

[permalink] [raw]
Subject: [NFS] [PATCH] nfs-utils: fix CROSSMOUNT test in utils/mountd/cache.c

While debugging problems with nfs-utils, I noticed the following bit of
code:


/* If one is a CROSSMOUNT, then prefer the longest path */
if (((found->m_export.e_flags & NFSEXP_CROSSMOUNT) ||
(found->m_export.e_flags & NFSEXP_CROSSMOUNT)) &&
strlen(found->m_export.e_path) !=
strlen(found->m_export.e_path)) {

This will never actually be hit since the two strlens are always the
same!

Here is a simple patch to fix this to what I assume the intent was:

Signed-off-by: Frank Filz <[email protected]>

--- ./utils/mountd/cache.c.orig 2008-01-31 11:09:10.000000000 -0800
+++ ./utils/mountd/cache.c 2008-01-31 11:09:53.000000000 -0800
@@ -708,9 +708,9 @@ void nfsd_export(FILE *f)
}
/* If one is a CROSSMOUNT, then prefer the longest path */
if (((found->m_export.e_flags & NFSEXP_CROSSMOUNT) ||
- (found->m_export.e_flags & NFSEXP_CROSSMOUNT)) &&
+ (exp->m_export.e_flags & NFSEXP_CROSSMOUNT)) &&
strlen(found->m_export.e_path) !=
- strlen(found->m_export.e_path)) {
+ strlen(exp->m_export.e_path)) {

if (strlen(exp->m_export.e_path) >
strlen(found->m_export.e_path)) {



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
_______________________________________________
Please note that [email protected] is being discontinued.
Please subscribe to [email protected] instead.
http://vger.kernel.org/vger-lists.html#linux-nfs