Re: open() and ESTALE error

From: Andrey Alekseyev (uitm_at_blackflag.ru)
Date: 06/20/03

  • Next message: Terry Lambert: "Re: nscd for freebsd"
    To: truckman@FreeBSD.org (Don Lewis)
    Date: Fri, 20 Jun 2003 11:18:24 +0400 (MSD)
    
    

    Don,

    > I can't get very enthusiastic about changing the file system independent
    > code to fix a deficiency in the NFS implementation.

    You're right. But it appears to be hard and inefficient to fix NFS for this
    (I tried, though). It will certainly require to pass names below VFS.
    On the other hand, there are NFS-related functions in the VFS already. See
    vfs_syscalls.c:getfh(), fhopen() and similar functions. There are things
    related to NFS server in the UFS/FFS code too. So, I finally decided
    that my "fix" doesn't do much harm to the above mentioned concept :)

    > current working directory, and your current working directory is nuked
    > on the server, vn_open will return ESTALE, and your patch above will
    > loop forever.

    It won't loop forever :) The "stale" integer is in there exactly for that
    purpose :) In case of a stale current directory, open() will still return
    ESTALE. In case of a file that was rm'd from the server, I believe
    it'll return something different.

    > If the rename on the server was done within the attribute validity time
    > on the client, vn_open() will succeed even without your patch, but you
    > may encounter the ESTALE error when you actually try to read or write
    > the file.

    Sure! But open() will succeed and probably you'll even be lucky to get
    file contents from the cache. But that's another story, related to
    attributes tuning (I have another patch for that:) However, even with
    the existing FreeBSD NFS attribute cache behaviour, it's ok for me.

    > server could do the rename while the client has the file open, after
    > which some I/O operation on the client will encounter ESTALE.

    Sure. That's perfectly understood. I'm not trying to solve all the
    NFS inefficiencies related to heavily shared files.

    > acdirmin/acdirmax, or a new handle timeout parameter. This may decrease
    > performance, but nothing is free ...

    In the normal situation, namecache entry+vnode+nfsnode+file handle may
    stay cached for a really long time (until re-used? deleted or renamed
    on the *client*). Expiring file handles (a new mechanism?) means much the
    same to me as simply obtaining a new name cache entry+other data
    on ESTALE :) I may be wrong, though.

    Anyway, thanks for the comments.

    See also:
    http://www.blackflag.ru/patches/nfs_attr.txt
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Terry Lambert: "Re: nscd for freebsd"

    Relevant Pages

    • 2.6.4-rc1-mm2
      ... Fix up fastcall-warning-fixes.patch ... NFS updates ... Small fixes to the posix message queue code ... parport: use module_initfor low-level driver init ...
      (Linux-Kernel)
    • Re: [GIT] More NFS client fixes for 2.6.24-rc6
      ... commit 4584f520e1f773082ef44ff4f8969a5d992b16ec (NFS: Fix NFS ... Also add in the same namespace Oops fix for NFSv4 in both the mountpoint ...
      (Linux-Kernel)
    • 2.6.4-mm1
      ... Fix a warning ... Warning fixes ... Update to NFS mount.... ... posix message queues: syscall stubs ...
      (Linux-Kernel)
    • 2.6.4-rc2-mm1
      ... - Brought back Ingo's patch which permits remap_file_pagesto set the ... Fix nasty memory management race. ... and was a duplicate of other IDE patches. ... Update to NFS mount.... ...
      (Linux-Kernel)
    • Re: 2.6.4-mm1
      ... I guess it's been forgotten in some other patch. ... (and i hope it's the good fix:) ... > - Various little fixes as usual. ... > nfs: Remove an unnecessary spinlock from XID generation... ...
      (Linux-Kernel)