On Tue, 16 Dec 2008 18:48:13 +0100, Nicolas Williams <Nicolas.Williams at 
sun.com> wrote:

> On Tue, Dec 16, 2008 at 06:42:01PM +0100, Frank Batschulat (Home) wrote:
>> On Tue, 16 Dec 2008 18:28:02 +0100, Nicolas Williams <Nicolas.Williams at 
>> sun.com> wrote:
>>
>> > On Tue, Dec 16, 2008 at 02:22:20PM +0100, Pavel Filipensky wrote:
>> >> this is a fix for "6778894 umountall -l still not really local yet".
>> >> webrev: http://cr.opensolaris.org/~pavelf/6778894/
>> >>
>> >> Background: My recent fix for "6675447  NFSv4 client hangs
>> >> on shutdown if server is down beforehand" is built on "umountall -l",
>> >> but as noted above umountall -l still not really local yet.
>> >> Unless umountall -l is fixed, the NFSv4 client can still hang
>> >> on shutdown if server is down beforehand.
>> >
>> > So df -n doesn't hang when NFS servers are non-responsive?
>>
>> outch! Thanks !
>>
>> Yes, of course, df uses statvfs() and statvfs() will go OTW for NFS.
>
> Does it?  truss doesn't show it doing that when the -n option is used,
> it only fstat64()s stdout.

yepp, df gets this information of the mnttab entry, on start
it read in the entire mnttab, the entries itself provide anything
it needs to know for 'df -n'

     69 struct extmnttab {
     70         char    *mnt_special;
     71         char    *mnt_mountp;
     72         char    *mnt_fstype;
     73         char    *mnt_mntopts;
     74         char    *mnt_time;
     75         uint_t  mnt_major;
     76         uint_t  mnt_minor;
     77 };

connects this internally to:

    157 struct mtab_entry {
    158         bool_int        mte_dev_is_valid;
    159         dev_t           mte_dev;
    160         bool_int        mte_ignore;     /* the "ignore" option was set 
*/
    161         struct extmnttab        *mte_mount;
    162 };

from this it builds the df_request:

    165 struct df_request {
    166         bool_int                dfr_valid;
    167         char                    *dfr_cmd_arg;   /* what the user 
specified */
    168         struct mtab_entry       *dfr_mte;
    169         char                    *dfr_fstype;
    170         int                     dfr_index;      /* to make qsort stable 
*/
    171 };

and the output callback for '-n' finally does:

   1636 n_output(struct df_request *dfrp, struct statvfs64 *fsp)
   1637 {
   1638         (void) printf("%-*s: %-*s\n",
   1639             MOUNT_POINT_WIDTH, DFR_MOUNT_POINT(dfrp),
   1640             FSTYPE_WIDTH, dfrp->dfr_fstype);
   1641 }

   173 #define  DFR_MOUNT_POINT(dfrp)   (dfrp)->dfr_mte->mte_mount->mnt_mountp

we are safe...puhhhhh....

---
frankB


Reply via email to