25 Jun, 2005

4 commits


24 Jun, 2005

36 commits

  • Another rollup of patches which give various symbols static scope

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • This patch reworks filemap_xip.c with the goal to reduce code duplication
    from mm/filemap.c. It applies agains 2.6.12-rc6-mm1. Instead of
    implementing the aio functions, this one implements the synchronous
    read/write functions only. For readv and writev, the generic fallback is
    used. For aio, we rely on the application doing the fallback. Since our
    "synchronous" function does memcpy immediately anyway, there is no
    performance difference between using the fallbacks or implementing each
    operation.

    Signed-off-by: Carsten Otte
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Carsten Otte
     
  • These are the ext2 related parts. Ext2 now uses the xip_* file operations
    along with the get_xip_page aop when mounted with -o xip.

    Signed-off-by: Carsten Otte
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Carsten Otte
     
  • - generic_file* file operations do no longer have a xip/non-xip split
    - filemap_xip.c implements a new set of fops that require get_xip_page
    aop to work proper. all new fops are exported GPL-only (don't like to
    see whatever code use those except GPL modules)
    - __xip_unmap now uses page_check_address, which is no longer static
    in rmap.c, and defined in linux/rmap.h
    - mm/filemap.h is now much more clean, plainly having just Linus'
    inline funcs moved here from filemap.c
    - fix includes in filemap_xip to make it build cleanly on i386

    Signed-off-by: Carsten Otte
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Carsten Otte
     
  • This patch updates some comments to match code changes.

    Signed-off-by: Martin Waitz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Waitz
     
  • Set the recovery directory via /proc/fs/nfsd/nfs4recoverydir.

    It may be changed any time, but is used only on startup.

    Signed-off-by: Andy Adamson
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • This patch adds the code to create and remove client subdirectories from the
    recovery directory, as described in the previous patch comment.

    Signed-off-by: Andy Adamson
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • NFSv4 clients are required to know what state they have on the server so that
    they can reclaim it on server reboot. However, it is possible for
    pathalogical combinations of server reboots and network partitions to leave a
    client in a state where it cannot know whether it has lost its state on the
    server.

    For this reason, rfc3530 requires that we store some information about clients
    to stable storage.

    So we maintain a directory /var/lib/nfs/v4recovery with a subdirectory for
    each client with active state. We leave open the possibility of including
    files underneath each such subdirectory with information about the client, but
    for now the subdirectories are empty.

    We create a client subdirectory whenever a client makes its first non-reclaim
    open_confirm.

    We remove a client subdirectory whenever either
    a) its lease expires, or
    b) the grace period ends without it reclaiming anything.
    When handling reclaims, we allow the reclaim if and only if the client doing
    the reclaim has a subdirectory.

    This patch adds just the code to scan the recovery directory on nfsd startup.

    Signed-off-by: Andy Adamson
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • The cb_parsed field is only used by probe_callback, to determine whether the
    callback information has been filled in by setclientid. But there is no way
    that probe_callback() can be called without that having already happened, so
    that check is superfluous, as is cb_parsed.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • >From the language of rfc3530 section 8.1.3 (e.g., the suggestion that a
    "process id" might be a reasonable lockowner value) it's conceivable that a
    client might want to use the same lockowner string on multiple files, so we may
    as well allow that. We expect each use of open_to_lockowner to create a
    distinct seqid stream, though.

    For now we're also allowing multiple uses of open_to_lockowner with the same
    open, though it seems unlikely clients would actually do that.

    Also add a comment reminding myself of some very non-scalable data structures.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Trivial renaming patch:

    I can never remember, while looking at various lists relating the nfsd4 state
    structures, which are the "heads" and which are items on other lists, or which
    structures are actually on the various lists. The following convention helps
    me: given structures foo and bar, with foo containing the head of a list of
    bars, use "bars" for the name of the head of the list contained in the struct
    foo, and use "per_foo" for the entries in the struct bars.

    Already done for struct nfs4_file; go ahead and do it for the other nfsd4
    state structures.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Minor cleanup, remove some unnecessary printk's.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Trivial whitespace and comment fixes.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Change from "goto" to "else if" format in setclientid_confirm.

    From: Fred Isaman
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • NFS4_INVAL is not a valid error for setclientid_confirm, and INUSE is the more
    logical error here anyway.

    From: Fred Isaman
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Setclientid_confirm code confused states 1 and 3 (numbering from the
    IMPLEMENTATION section of rfc3530, section 14.2.33). Fix this.

    State 1 allows the client to change the callback channel on the fly. We don't
    implement this currently, so just turn off the callback channel in this case.

    From: Fred Isaman
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Setclientid code assumes there is only one match in unconfirmed list.
    Make sure that assumption holds.

    From: Fred Isaman
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • This patch contains the following possible cleanups:

    - make needlessly global code static

    Signed-off-by: Adrian Bunk
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • For the purposes of reboot recovery, we want to do some work during the
    transition period at the end of the grace period. Some of that work must be
    guaranteed to have a certain relationship with the end of the grace period, so
    we want to control the transition there.

    Our approach is to modify the in_grace() checks to consult a global variable
    instead of checking the time directly, to schedule the first run of the
    laundromat thread at the end of the grace period, and to set the global
    end-of-grace-period there.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Minor setclientid cleanup

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • For the purposes of reboot recovery we keep a directory with subdirectories
    each having a name that is the ascii hex representation of the md5 sum of a
    client identifier for an active client.

    This adds the code to calculate that name. We also use it for the purposes of
    comparing clients, so if someone ever manages to find two client names that
    are md5 collisions, then we'll return clid_inuse to the second.

    Signed-off-by: Andy Adamson
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • We can be a little more concise here.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Adopt standard kernel style by defining a no-op function instead of putting
    ifdef's in the code where the function is called.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • nfs4_reclaim_init is no longer performing any useful function.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Separate out stuff that needs initialization on startup from stuff that only
    needs initialization on module init from static data.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Somewhat gratuitous rename to simplify following patch.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Allow recovery of delegations after reboot.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • The only way the protocol gives to change the lease time on the fly is to
    simulate a reboot. We don't have that completely right in the current code;
    among other things, we should probably put lockd in grace too while we do
    this.

    For now, let's just keep this simple, and wait till the next time nfsd starts
    to register any changes in lease time. If the administrator really wants to
    change the lease time *now*, they can go ahead and bring nfsd down and then
    back up again after changing the lease time.

    Also remove the "if (reclaim_str_hashtbl_size == 0)" case, a shortcut which
    skips the grace period if we know of no clients in need of recovery. This
    isn't going to work well with nlm.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • We're running the laundromat work on the default kevent worker thread. But
    the laundromat takes the nfsv4 state semaphore, which is used for way too much
    stuff, and the potential for deadlocks is high. Better to have this on a
    separate workqueue.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Minor cleanup.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • rpc_create_client was modified recently to do its own (synchronous) NULL ping
    of the server. We'd rather do that on our own, asynchronously, so that we
    don't have to block the nfsd thread doing the probe, and so that setclientid
    handling (hence, client mounts) can proceed normally whether the callback is
    succesful or not. (We can still function fine without the callback
    channel--we just won't be able to give out delegations till it's verified to
    work.)

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • We're trying to read and write from a struct file that we may not hold a
    reference to any more (since a close could be processed as soon as we drop the
    state lock).

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Silence another annoying "failed to contact portmap (errno -512)" on shutdown.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Add a struct kref to each nfs4_file and take a reference to it from each
    stateid and delegation that refers to it. The atomicity guarantees are
    overkill given that all this stuff is done under the single nfsd4 state lock,
    but a) we'd like finer-grained locking some day, and b) this simplifies the
    cleanup of the structures a bit, something that has previously been a bit
    complicated and bug-prone.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • Trivial renaming patch:

    I can never remember, while looking at various lists relating the nfsd4 state
    structures, which are the "heads" and which are items on other lists, or which
    structures are actually on the various lists. The following convention helps
    me: given structures foo and bar, with foo containing the head of a list of
    bars, use "bars" for the name of the head of the list contained in the struct
    foo, and use "per_foo" for the entries in the struct bars.

    Go ahead and do this for struct nfs4_file.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown
     
  • These remaining debugging counters haven't proved that useful.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    NeilBrown