30 May, 2011

29 commits

  • * 'pnfs-submit' of git://git.open-osd.org/linux-open-osd: (32 commits)
    pnfs-obj: pg_test check for max_io_size
    NFSv4.1: define nfs_generic_pg_test
    NFSv4.1: use pnfs_generic_pg_test directly by layout driver
    NFSv4.1: change pg_test return type to bool
    NFSv4.1: unify pnfs_pageio_init functions
    pnfs-obj: objlayout_encode_layoutcommit implementation
    pnfs: encode_layoutcommit
    pnfs-obj: report errors and .encode_layoutreturn Implementation.
    pnfs: encode_layoutreturn
    pnfs: layoutret_on_setattr
    pnfs: layoutreturn
    pnfs-obj: osd raid engine read/write implementation
    pnfs: support for non-rpc layout drivers
    pnfs-obj: define per-inode private structure
    pnfs: alloc and free layout_hdr layoutdriver methods
    pnfs-obj: objio_osd device information retrieval and caching
    pnfs-obj: decode layout, alloc/free lseg
    pnfs-obj: pnfs_osd XDR client implementation
    pnfs-obj: pnfs_osd XDR definitions
    pnfs-obj: objlayoutdriver module skeleton
    ...

    Linus Torvalds
     
  • * 'nfs-for-2.6.40' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
    SUNRPC: Support for RPC over AF_LOCAL transports
    SUNRPC: Remove obsolete comment
    SUNRPC: Use AF_LOCAL for rpcbind upcalls
    SUNRPC: Clean up use of curly braces in switch cases
    NFS: Revert NFSROOT default mount options
    SUNRPC: Rename xs_encode_tcp_fragment_header()
    nfs,rcu: convert call_rcu(nfs_free_delegation_callback) to kfree_rcu()
    nfs41: Correct offset for LAYOUTCOMMIT
    NFS: nfs_update_inode: print current and new inode size in debug output
    NFSv4.1: Fix the handling of NFS4ERR_SEQ_MISORDERED errors
    NFSv4: Handle expired stateids when the lease is still valid
    SUNRPC: Deal with the lack of a SYN_SENT sk->sk_state_change callback...

    Linus Torvalds
     
  • Implement pg_test vector to test for max IO sizes. We calculate
    a max_io_size member only once, and cache it in lseg so to not
    do so on every page insert.

    Signed-off-by: Boaz Harrosh
    [simplify logic]
    Signed-off-by: Benny Halevy

    Boaz Harrosh
     
  • By default, unless pnfs is used coalesce pages until pg_bsize
    (rsize or wsize) is reached.

    pnfs layout drivers define their own pg_test methods that use
    pnfs_generic_pg_test and need to define their own I/O size
    limits (e.g. based on the file stripe size).

    [Move a check from nfs_pageio_do_add_request to nfs_generic_pg_test]
    Signed-off-by: Boaz Harrosh
    Signed-off-by: Benny Halevy

    Boaz Harrosh
     
  • Signed-off-by: Benny Halevy

    Benny Halevy
     
  • Signed-off-by: Benny Halevy

    Benny Halevy
     
  • Use common code for pnfs_pageio_init_{read,write} and use
    a common generic pg_test function.

    Note that this function always assumes the the layout driver's
    pg_test method is implemented.

    [Fix BUG]
    Signed-off-by: Boaz Harrosh
    Signed-off-by: Benny Halevy

    Benny Halevy
     
  • * Define API for io-engines to report delta_space_used in IOs
    * Encode the osd-layout specific information of the layoutcommit
    XDR buffer.

    Signed-off-by: Boaz Harrosh
    Signed-off-by: Benny Halevy

    Boaz Harrosh
     
  • Add a layout driver method to encode the layout type specific
    opaque part of layout commit in-line in the xdr stream.

    Currently, the pnfs-objects layout driver uses it to encode metadata hints
    to the MDS and the blocks layout driver to commit provisionally allocated
    extents to the file.

    Signed-off-by: Benny Halevy

    Benny Halevy
     
  • An io_state pre-allocates an error information structure for each
    possible osd-device that might error during IO. When IO is done if all
    was well the io_state is freed. (as today). If the I/O has ended with an
    error, the io_state is queued on a per-layout err_list. When eventually
    encode_layoutreturn() is called, each error is properly encoded on the
    XDR buffer and only then the io_state is removed from err_list and
    de-allocated.

    It is up to the io_engine to fill in the segment that fault and the type
    of osd_error that occurred. By calling objlayout_io_set_result() for
    each failing device.

    In objio_osd:
    * Allocate io-error descriptors space as part of io_state
    * Use generic objlayout error reporting at end of io.

    Signed-off-by: Boaz Harrosh
    Signed-off-by: Benny Halevy

    Boaz Harrosh
     
  • Add a layout driver method to encode the layout type specific
    opaque part of layout return in-line in the xdr stream.

    Currently the pnfs-objects layout driver uses it to encode i/o error
    information on LAYOUTRETURN.

    Signed-off-by: Andy Adamson
    [fixup layout header pointer for encode_layoutreturn]
    Signed-off-by: Benny Halevy

    Andy Adamson
     
  • With the objects layout security model, we have object capabilities
    that are associated with the layout and we anticipate that the server
    will issue a cb_layoutrecall for any setattr that changes security
    related attributes (user/group/mode/acl) or truncates the file.

    Therefore, the layout is returned before issuing the setattr to avoid
    the anticipated cb_layoutrecall.

    Signed-off-by: Benny Halevy

    Benny Halevy
     
  • NFSv4.1 LAYOUTRETURN implementation

    Currently, does not support layout-type payload encoding.

    Signed-off-by: Alexandros Batsakis
    Signed-off-by: Andy Adamson
    Signed-off-by: Andy Adamson
    Signed-off-by: Dean Hildebrand
    Signed-off-by: Fred Isaman
    Signed-off-by: Fred Isaman
    Signed-off-by: Marc Eshel
    Signed-off-by: Zhang Jingwang
    [call pnfs_return_layout right before pnfs_destroy_layout]
    [remove assert_spin_locked from pnfs_clear_lseg_list]
    [remove wait parameter from the layoutreturn path.]
    [remove return_type field from nfs4_layoutreturn_args]
    [remove range from nfs4_layoutreturn_args]
    [no need to send layoutcommit from _pnfs_return_layout]
    [don't wait on sync layoutreturn]
    [fix layout stateid in layoutreturn args]
    [fixed NULL deref in _pnfs_return_layout]
    [removed recaim member of nfs4_layoutreturn_args]
    Signed-off-by: Benny Halevy

    Benny Halevy
     
  • With the use of the in-kernel osd library. Implement read/write
    of data from/to osd-objects according to information specified
    in the objects-layout.

    Support for stripping over mirrors with a received stripe_unit.
    There are however a few constrains which are not supported:
    1. Stripe Unit must be a multiple of PAGE_SIZE
    2. stripe length (stripe_unit * number_of_stripes) can not be
    bigger then 32bit.

    Also support raid-groups and partial-layout. Partial-layout is
    when not all the groups are received on the line, addressing
    only a partial range of the file.

    TODO:
    Only raid0! raid 4/5/6 support will come at later stage

    A none supported layout will send IO through the MDS

    [Important fallout from the last rebase]
    Signed-off-by: Boaz Harrosh
    [gfp_flags]
    Signed-off-by: Benny Halevy

    Boaz Harrosh
     
  • Non-rpc layout driver such as for objects and blocks
    implement their own I/O path and error handling logic.
    Therefore bypass NFS-based error handling for these layout drivers.

    [fix lseg ref-count bugs, and null de-refs]
    [Fall out from: non-rpc layout drivers]
    Signed-off-by: Boaz Harrosh
    [get rid of PNFS_USE_RPC_CODE]
    [get rid of __nfs4_write_done_cb]
    [revert useless change in nfs4_write_done_cb]
    Signed-off-by: Benny Halevy

    Benny Halevy
     
  • allocate and deallocate per-inode private pnfs_layout_hdr
    in preparation for I/O implementation.

    Signed-off-by: Boaz Harrosh
    Signed-off-by: Benny Halevy

    Benny Halevy
     
  • [gfp_flags]
    Signed-off-by: Benny Halevy

    Benny Halevy
     
  • When a new layout is received in objio_alloc_lseg all device_ids
    referenced are retrieved. The device information is queried for from MDS
    and then the osd_device is looked-up from the osd-initiator library. The
    devices are cached in a per-mount-point list, for later use. At unmount
    all devices are "put" back to the library.

    objlayout_get_deviceinfo(), objlayout_put_deviceinfo() middleware
    API for retrieving device information given a device_id.

    TODO: The device cache can get big. Cap its size. Keep an LRU and start
    to return devices which were not used, when list gets to big, or
    when new entries allocation fail.

    [pnfs-obj: Bugs in new global-device-cache code]
    Signed-off-by: Boaz Harrosh
    [gfp_flags]
    [use global device cache]
    [use layout driver in global device cache]
    Signed-off-by: Benny Halevy

    Boaz Harrosh
     
  • objlayout_alloc_lseg prepares an xdr_stream and calls the
    raid engins objio_alloc_lseg() to allocate a private
    pnfs_layout_segment.

    objio_osd.c::objio_alloc_lseg() uses passed xdr_stream to
    decode and store the layout_segment information in an
    objio_segment struct, using the pnfs_osd_xdr.h API for
    the actual parsing the layout xdr.

    objlayout_free_lseg calls objio_free_lseg() to free the
    allocated space.

    Signed-off-by: Boaz Harrosh
    [gfp_flags]
    [removed "extern" from function definitions]
    Signed-off-by: Benny Halevy

    Boaz Harrosh
     
  • * Add the fs/nfs/objlayout/pnfs_osd_xdr_cli.c file, which will
    include the XDR encode/decode implementations for the pNFS
    client objlayout driver.

    [Wrong type in comments]
    Signed-off-by: Boaz Harrosh
    Signed-off-by: Benny Halevy

    Boaz Harrosh
     
  • * Define the PNFS_OBJLAYOUT Kconfig option in the nfs
    master Kconfig file.
    * Add the objlayout driver to the Kernel's Kbuild system.
    * Add the fs/nfs/objlayout/Kbuild file for building the
    objlayoutdriver.ko driver
    * Define fs/nfs/objlayout/objio_osd.c, register the driver on module
    initialization and unregister on exit.

    [pnfs-obj: remove of CONFIG_PNFS fallout]
    Signed-off-by: Boaz Harrosh
    [added "unsure" clause]
    [depend on NFS_V4_1]
    Signed-off-by: Benny Halevy

    Benny Halevy
     
  • A pNFS client auto-negotiates a lot of features (minorversion level,
    pNFS layout type, etc.). This is convenient, but makes certain kinds of
    failures hard for a user to detect.

    For example, if the client falls back on 4.0, or falls back to MDS IO
    because the user didn't connect to the right iscsi disks before
    mounting, the only symptoms may be reduced performance, which may not be
    noticed till long after the actual failure, and may be difficult for a
    user to diagnose.

    However, such "failures" may also be perfectly normal in some cases, so
    we don't want to spam the system logs with them.

    One approach would be to put some more information into
    /proc/self/mountstats.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Benny Halevy
    [pnfs: add commit client stats]
    [fixup data types for "ret" variables in pnfs_try_to* inline funcs.]
    Signed-off-by: Benny Halevy
    [fix definition of show_pnfs for !CONFIG_PNFS]
    Signed-off-by: Benny Halevy
    [nfs41: Fix show_sessions in the not CONFIG_NFS_V4_1 case]
    There is a build error when CONFIG_NFS_V4 is set but
    CONFIG_NFS_V4_1 is *not* set. show_sessions() prototype
    was unbalanced between the two cases.
    Signed-off-by: Boaz Harrosh
    [pnfs: super.c remove CONFIG_PNFS]
    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy

    J. Bruce Fields
     
  • Use recalled range to invalidate particular layout segments in the layout cache.

    Signed-off-by: Benny Halevy

    Benny Halevy
     
  • Signed-off-by: Benny Halevy

    Benny Halevy
     
  • Add offset and count parameters to pnfs_update_layout and use them to get
    the layout in the pageio path.

    Order cache layout segments in the following order:
    * offset (ascending)
    * length (descending)
    * iomode (RW before READ)

    Test byte range against the layout segment in use in pnfs_{read,write}_pg_test
    so not to coalesce pages not using the same layout segment.

    [fix lseg ordering]
    [clean up pnfs_find_lseg lseg arg]
    [remove unnecessary FIXME]
    [fix ordering in pnfs_insert_layout]
    [clean up pnfs_insert_layout]
    Signed-off-by: Benny Halevy

    Benny Halevy
     
  • Initialize xdr_stream and xdr_buf using an array of page pointers
    and length of buffer.

    Signed-off-by: Benny Halevy

    Benny Halevy
     
  • pnfs deviceids are unique per server, per layout type.
    struct nfs_client is currently used to distinguish deviceids from
    different nfs servers, yet these may clash between different layout
    types on the same server. Therefore, use the layout driver associated
    with each deviceid at insertion time to look it up, unhash, or
    delete it.

    Signed-off-by: Benny Halevy

    Benny Halevy
     
  • Note: This functionlaity is incomplete as all layout segments referring to
    the 'to be removed device id' need to be reaped, and all in flight I/O drained.

    [use be32 res in nfs4_callback_devicenotify]
    [use nfs_client to qualify deviceid for cb_notify_deviceid]
    [use global deviceid cache for CB_NOTIFY_DEVICEID]
    [refactor device cache _lookup_deviceid]
    [refactor device cache _find_get_deviceid]
    Signed-off-by: Benny Halevy
    [Bug in new global-device-cache code]
    [layout_driver MUST set free_deviceid_node if using dev-cache]
    Signed-off-by: Boaz Harrosh
    Signed-off-by: Benny Halevy

    Marc Eshel
     
  • Use the pnfs_layoutdriver_type both as a qualifier for the deviceid,
    distinguishing deviceid from different layout types on the server,
    and for freeing the layout-driver allocated structure containing the
    nfs4_deviceid_node.

    [BUG in _deviceid_purge_client]
    [layout_driver MUST set free_deviceid_node if using dev-cache]
    [let ver < 4.1 compile]
    Signed-off-by: Boaz Harrosh
    [removed EXPORT_SYMBOL_GPL(nfs4_deviceid_purge_client)]
    Signed-off-by: Benny Halevy

    Benny Halevy
     

29 May, 2011

4 commits


28 May, 2011

6 commits

  • Marek Belisko reports that recent attempts
    to fix regressions in NFSROOT have broken his configuration:

    > After update from 2.6.38-rc8 to 2.6.38 is mounting rootfs over nfs not possible.
    > Log:
    > VFS: Mounted root (nfs filesystem) on device 0:14.
    > Freeing init memory: 132K
    > nfs: server 10.146.1.21 not responding, still trying
    > nfs: server 10.146.1.21 not responding, still trying
    >
    > This is never ending. I make short bisect (not too much commits
    > between versions)
    > and bad commit was reported: 53d4737580535e073963b91ce87d4216e434fab5
    >
    > NFS: NFSROOT should default to "proto=udp"
    >
    > I've tested on mini2440 board (DM9000, static IP).
    > Is there some missing option or something else to be checked?

    An examination of a network trace captured during the failure shows
    that the mount is actually succeeding, but that the client is not
    seeing READ replies larger than 16KB. This could be a local packet
    filtering issue on the client, but we didn't troubleshoot this
    further because of the reported "git bisect" result.

    Last fall we removed the ad hoc mount option parser in
    fs/nfs/nfsroot.c in favor of using the main parser in fs/nfs/super.c
    (see commit 56463e50 "NFS: Use super.c for NFSROOT mount option
    parsing"). That commit changed the default NFSROOT mount options to
    be the same as those employed by user space mounts.

    As it turns out, these new default mount options are not tolerated by
    many embedded systems. So far these problems have been due to
    specific behavior of certain embedded NICs. The NFS community does
    not have such hardware on hand for running tests.

    Commit 53d47375 recently introduced a clean way to specify default
    mount options for NFSROOT, so we can now easily restore the
    traditional defaults for NFSROOT:

    vers=2,udp,rsize=4096,wsize=4096

    This should revert the new default NFSROOT mount options introduced
    with commit 56463e50.

    Tested-by: Marek Belisto
    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • The rcu callback nfs_free_delegation_callback() just calls a kfree(),
    so we use kfree_rcu() instead of the call_rcu(nfs_free_delegation_callback).

    Signed-off-by: Lai Jiangshan
    Signed-off-by: Paul E. McKenney
    Cc: Trond Myklebust
    Signed-off-by: Trond Myklebust

    Lai Jiangshan
     
  • A client sends offset to MDS as it was seen by DS. As result,
    file size after copy is only half of original file size in case
    of 2 DS.

    Signed-off-by: Vitaliy Gusev
    Cc: stable@kernel.org [2.6.39]
    Signed-off-by: Trond Myklebust

    Vitaliy Gusev
     
  • Hi Trond,

    In nfs_update_inode debug output, print the current and new inode
    size when the file size changes on the NFS server.

    Signed-off-by: Harshula Jayasuriya
    Reviewed-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Harshula Jayasuriya
     
  • Currently, the call to nfs4_schedule_session_recovery() will actually just
    result in a test of the lease when what we really want is to force a
    session reset.

    Signed-off-by: Trond Myklebust
    Cc: stable@kernel.org

    Trond Myklebust
     
  • Currently, if the server returns NFS4ERR_EXPIRED in reply to a READ or
    WRITE, but the RENEW test determines that the lease is still active, we
    fail to recover and end up looping forever in a READ/WRITE + RENEW death
    spiral.

    Signed-off-by: Trond Myklebust
    Cc: stable@kernel.org

    Trond Myklebust
     

25 May, 2011

1 commit

  • Change each shrinker's API by consolidating the existing parameters into
    shrink_control struct. This will simplify any further features added w/o
    touching each file of shrinker.

    [akpm@linux-foundation.org: fix build]
    [akpm@linux-foundation.org: fix warning]
    [kosaki.motohiro@jp.fujitsu.com: fix up new shrinker API]
    [akpm@linux-foundation.org: fix xfs warning]
    [akpm@linux-foundation.org: update gfs2]
    Signed-off-by: Ying Han
    Cc: KOSAKI Motohiro
    Cc: Minchan Kim
    Acked-by: Pavel Emelyanov
    Cc: KAMEZAWA Hiroyuki
    Cc: Mel Gorman
    Acked-by: Rik van Riel
    Cc: Johannes Weiner
    Cc: Hugh Dickins
    Cc: Dave Hansen
    Cc: Steven Whitehouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ying Han