Questions about Exportfs / kernel nfs server / dentrys (2.6.9)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm trying to understand some code in exportfs. The particular code is
in find_exported_dentry. Here is some pseudocode from
find_exported_dentry. I've stripped out the error-checking code and
included invariants that describe what I believe is going on.

INPUT: struct dentry *pd
/* struct dentry *pd is a disconnected dentry that we want to connect.
* it was probably created with d_alloc_anon. Note that IS_ROOT(pd)
* is TRUE.
*/

/* call export ops to get parent of pd */
ppd = CALL(nops, get_parent)(pd);

/* call export ops to get name of pd */
CALL(nops, get_name)(ppd, nbuf, pd)

/* perform a lookup using the name we received. We know that pd is a
* child of ppd, and we know that pd's name is 'nbuf', so the lookup
* should succeed and return us a non-anonymous dentry.
*/
npd = lookup_one_len(nbuf, ppd, strlen(nbuf));
/* In my test run, pd != ndp. This is because pd is an anonymous dentry
* and npd is a non-anonymous one, containing a name. Code comments
* say this is alright.
*/

if (IS_ROOT(pd)) {
    /* something went wrong, we have to give up */
   break;
}

The function is failing for me on that last IS_ROOT check in the if
statement. What I'm confused about is when was pd supposed to have
gone from unconnected to connected? In my test runs, npd is connected
but pd is not. They both have the same inode number. They both point
to the same inode.

Thanks,
Scott
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux