31 Oct, 2010

2 commits

  • The caller allocated it, the caller should free it.

    The only issue so far is that we could change the flp pointer even on an
    error return if the fl_change callback failed. But we can simply move
    the flp assignment after the fl_change invocation, as the callers don't
    care about the flp return value if the setlease call failed.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • We modified setlease to require the caller to allocate the new lease in
    the case of creating a new lease, but forgot to fix up the filesystem
    methods.

    Cc: Steven Whitehouse
    Cc: Steve French
    Cc: Trond Myklebust
    Signed-off-by: J. Bruce Fields
    Acked-by: Arnd Bergmann
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     

29 Oct, 2010

3 commits


28 Oct, 2010

5 commits


27 Oct, 2010

6 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (52 commits)
    split invalidate_inodes()
    fs: skip I_FREEING inodes in writeback_sb_inodes
    fs: fold invalidate_list into invalidate_inodes
    fs: do not drop inode_lock in dispose_list
    fs: inode split IO and LRU lists
    fs: switch bdev inode bdi's correctly
    fs: fix buffer invalidation in invalidate_list
    fsnotify: use dget_parent
    smbfs: use dget_parent
    exportfs: use dget_parent
    fs: use RCU read side protection in d_validate
    fs: clean up dentry lru modification
    fs: split __shrink_dcache_sb
    fs: improve DCACHE_REFERENCED usage
    fs: use percpu counter for nr_dentry and nr_dentry_unused
    fs: simplify __d_free
    fs: take dcache_lock inside __d_path
    fs: do not assign default i_ino in new_inode
    fs: introduce a per-cpu last_ino allocator
    new helper: ihold()
    ...

    Linus Torvalds
     
  • * 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
    NFS: rename nfs.upcall -> nfs.idmap
    NFS: Fix a compile issue in nfs_root

    Linus Torvalds
     
  • This removes more dead code that was somehow missed by commit 0d99519efef
    (writeback: remove unused nonblocking and congestion checks). There are
    no behavior change except for the removal of two entries from one of the
    ext4 tracing interface.

    The nonblocking checks in ->writepages are no longer used because the
    flusher now prefer to block on get_request_wait() than to skip inodes on
    IO congestion. The latter will lead to more seeky IO.

    The nonblocking checks in ->writepage are no longer used because it's
    redundant with the WB_SYNC_NONE check.

    We no long set ->nonblocking in VM page out and page migration, because
    a) it's effectively redundant with WB_SYNC_NONE in current code
    b) it's old semantic of "Don't get stuck on request queues" is mis-behavior:
    that would skip some dirty inodes on congestion and page out others, which
    is unfair in terms of LRU age.

    Inspired by Christoph Hellwig. Thanks!

    Signed-off-by: Wu Fengguang
    Cc: Theodore Ts'o
    Cc: David Howells
    Cc: Sage Weil
    Cc: Steve French
    Cc: Chris Mason
    Cc: Jens Axboe
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wu Fengguang
     
  • Stephen Rothwell reports:

    > /home/test/linux-2.6/fs/nfs/nfsroot.c: In function 'nfs_root_debug':
    > /home/test/linux-2.6/fs/nfs/nfsroot.c:110:2: error: 'nfs_debug'
    > undeclared (first use in this function)
    > /home/test/linux-2.6/fs/nfs/nfsroot.c:110:2: note: each undeclared
    > identifier is reported only once for each function it appears in
    > make[3]: *** [fs/nfs/nfsroot.o] Error 1
    > make[2]: *** [fs/nfs] Error 2
    > make[1]: *** [fs] Error 2
    > make: *** [sub-make] Error 2

    Which is caused by commit 306a075362a288683f6346185f97dd0e06df19da
    (NFS: Allow NFSROOT debugging messages to be enabled dynamically)

    Fix is to disable this code when RPC_DEBUG is disabled.

    Reported-by: Zimny Lech
    Tested-by: Ingo Molnar
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • * 'for-2.6.37' of git://linux-nfs.org/~bfields/linux: (99 commits)
    svcrpc: svc_tcp_sendto XPT_DEAD check is redundant
    svcrpc: no need for XPT_DEAD check in svc_xprt_enqueue
    svcrpc: assume svc_delete_xprt() called only once
    svcrpc: never clear XPT_BUSY on dead xprt
    nfsd4: fix connection allocation in sequence()
    nfsd4: only require krb5 principal for NFSv4.0 callbacks
    nfsd4: move minorversion to client
    nfsd4: delay session removal till free_client
    nfsd4: separate callback change and callback probe
    nfsd4: callback program number is per-session
    nfsd4: track backchannel connections
    nfsd4: confirm only on succesful create_session
    nfsd4: make backchannel sequence number per-session
    nfsd4: use client pointer to backchannel session
    nfsd4: move callback setup into session init code
    nfsd4: don't cache seq_misordered replies
    SUNRPC: Properly initialize sock_xprt.srcaddr in all cases
    SUNRPC: Use conventional switch statement when reclassifying sockets
    sunrpc/xprtrdma: clean up workqueue usage
    sunrpc: Turn list_for_each-s into the ..._entry-s
    ...

    Fix up trivial conflicts (two different deprecation notices added in
    separate branches) in Documentation/feature-removal-schedule.txt

    Linus Torvalds
     
  • * 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
    net/sunrpc: Use static const char arrays
    nfs4: fix channel attribute sanity-checks
    NFSv4.1: Use more sensible names for 'initialize_mountpoint'
    NFSv4.1: pnfs: filelayout: add driver's LAYOUTGET and GETDEVICEINFO infrastructure
    NFSv4.1: pnfs: add LAYOUTGET and GETDEVICEINFO infrastructure
    NFS: client needs to maintain list of inodes with active layouts
    NFS: create and destroy inode's layout cache
    NFSv4.1: pnfs: filelayout: introduce minimal file layout driver
    NFSv4.1: pnfs: full mount/umount infrastructure
    NFS: set layout driver
    NFS: ask for layouttypes during v4 fsinfo call
    NFS: change stateid to be a union
    NFSv4.1: pnfsd, pnfs: protocol level pnfs constants
    SUNRPC: define xdr_decode_opaque_fixed
    NFSD: remove duplicate NFS4_STATEID_SIZE

    Linus Torvalds
     

26 Oct, 2010

3 commits

  • The sanity checks here are incorrect; in the worst case they allow
    values that crash the client.

    They're also over-reliant on the preprocessor.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    J. Bruce Fields
     
  • Clones an existing reference to inode; caller must already hold one.

    Signed-off-by: Al Viro

    Al Viro
     
  • * 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (67 commits)
    SUNRPC: Cleanup duplicate assignment in rpcauth_refreshcred
    nfs: fix unchecked value
    Ask for time_delta during fsinfo probe
    Revalidate caches on lock
    SUNRPC: After calling xprt_release(), we must restart from call_reserve
    NFSv4: Fix up the 'dircount' hint in encode_readdir
    NFSv4: Clean up nfs4_decode_dirent
    NFSv4: nfs4_decode_dirent must clear entry->fattr->valid
    NFSv4: Fix a regression in decode_getfattr
    NFSv4: Fix up decode_attr_filehandle() to handle the case of empty fh pointer
    NFS: Ensure we check all allocation return values in new readdir code
    NFS: Readdir plus in v4
    NFS: introduce generic decode_getattr function
    NFS: check xdr_decode for errors
    NFS: nfs_readdir_filler catch all errors
    NFS: readdir with vmapped pages
    NFS: remove page size checking code
    NFS: decode_dirent should use an xdr_stream
    SUNRPC: Add a helper function xdr_inline_peek
    NFS: remove readdir plus limit
    ...

    Linus Torvalds
     

25 Oct, 2010

16 commits

  • The initialize_mountpoint/uninitialise_mountpoint functions are really about
    setting or clearing the layout driver to be used on this filesystem. Change
    the names to the more descriptive 'set_layoutdriver/clear_layoutdriver'.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Implement the driver's io_ops->alloc_lseg and free_lseg functions,
    which integrate into the deviceid cache and calls out to
    nfs4_proc_getdeviceinfo when necessary.

    Signed-off-by: Andy Adamson
    Signed-off-by: Dean Hildebrand
    Signed-off-by: Marc Eshel
    Signed-off-by: Mike Sager
    Signed-off-by: Oleg Drokin
    Signed-off-by: Ricardo Labiaga
    Signed-off-by: Tao Guo
    Signed-off-by: Boaz Harrosh
    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • Add the ability to actually send LAYOUTGET and GETDEVICEINFO. This also adds
    in the machinery to handle layout state and the deviceid cache. Note that
    GETDEVICEINFO is not called directly by the generic layer. Instead it
    is called by the drivers while parsing the LAYOUTGET opaque data in response
    to an unknown device id embedded therein. RFC 5661 only encodes
    device ids within the driver-specific opaque data.

    Signed-off-by: Andy Adamson
    Signed-off-by: Dean Hildebrand
    Signed-off-by: Marc Eshel
    Signed-off-by: Mike Sager
    Signed-off-by: Ricardo Labiaga
    Signed-off-by: Tao Guo
    Signed-off-by: Boaz Harrosh
    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • In particular, server reboot will invalidate all layouts.

    Note that in order to have an active layout, we must get a successful response
    from the server. To avoid adding that machinery, this patch just includes a
    stub that fakes up a successful return. Since the layout is never referenced
    for io, this is not a problem.

    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    Signed-off-by: Dean Hildebrand
    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • At the start of the io paths, try to grab the relevant layout
    information. This will initiate the inode's layout cache, but
    stubs ensure the cache stays empty.

    Signed-off-by: Benny Halevy
    Signed-off-by: Dean Hildebrand
    Signed-off-by: Marc Eshel
    Signed-off-by: Tao Guo
    Signed-off-by: Ricardo Labiaga
    Signed-off-by: Boaz Harrosh
    Signed-off-by: Andy Adamson
    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Benny Halevy
     
  • This driver just registers itself and supplies trivial mount/umount functions.

    Signed-off-by: Dean Hildebrand
    Signed-off-by: Marc Eshel
    Signed-off-by: Benny Halevy
    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Dean Hildebrand
     
  • Allow a module implementing a layout type to register, and
    have its mount/umount routines called for filesystems that
    the server declares support it.

    Signed-off-by: Fred Isaman
    Signed-off-by: Marc Eshel
    Signed-off-by: Andy Adamson
    Signed-off-by: Bian Naimeng
    Signed-off-by: Benny Halevy
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • Put in the infrastructure that uses information returned from the
    server at mount to select a layout driver module.

    In this patch, a stub is used that always returns "no driver found".

    Signed-off-by: Ricardo Labiaga
    Signed-off-by: Dean Hildebrand
    Signed-off-by: Marc Eshel
    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Ricardo Labiaga
     
  • This information will be used to determine which layout driver,
    if any, to use for subsequent IO on this filesystem. Each driver
    is assigned an integer id, with 0 reserved to indicate no driver.

    The server can in theory return multiple ids. However, our current
    client implementation only notes the first entry and ignores the
    rest.

    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy
    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • In NFSv4.1 the stateid consists of the other and seqid fields. For layout
    processing we need to numerically compare the seqid value of layout stateids.
    To do so, introduce a union to nfs4_stateid to switch between opaque(16 bytes)
    and opaque(12 bytes) / __be32

    Signed-off-by: Alexandros Batsakis
    Signed-off-by: Benny Halevy
    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Alexandros Batsakis
     
  • Return value of "decode_attr_bitmap()" was not checked;

    Signed-off-by: Roman Borisov
    Signed-off-by: Trond Myklebust

    Roman Borisov
     
  • Used by the client to determine if the server has a granular enough
    time stamp.

    Signed-off-by: Ricardo Labiaga
    Signed-off-by: Trond Myklebust

    Ricardo Labiaga
     
  • Instead of blindly zapping the caches, attempt to revalidate them if
    the server has indicated that it uses high resolution timestamps.

    NFSv4 should be able to always revalidate the cache since the
    protocol requires the update of the change attribute on modification of
    the data. In reality, there are servers (the Linux NFS server
    for example) that do not obey this requirement and use ctime as the
    basis for change attribute. Long term, the server needs to be fixed.
    At this time, and to be on the safe side, continue zapping caches if
    the server indicates that it does not have a high resolution timestamp.

    Signed-off-by: Ricardo Labiaga
    Signed-off-by: Trond Myklebust

    Ricardo Labiaga
     
  • Also ensure we only ask for either fileid or mounted_on_fileid in the
    readdirplus case too...

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Otherwise, we may end up reading uninitialised data from the resulting
    struct nfs_fattr.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

24 Oct, 2010

5 commits

  • We don't want to have the mounted_on_fileid overwrite the true fileid. We
    only return the former if the server didn't supply the true fileid.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • decode_attr_filehandle still needs to skip the XDR-encoded filehandle if
    someone passes a null pointer argument.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Also some clean ups.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • By requsting more attributes during a readdir, we can mimic the readdir plus
    operation that was in NFSv3.

    To test, I ran the command `ls -lU --color=none` on directories with various
    numbers of files. Without readdir plus, I see this:

    n files | 100 | 1,000 | 10,000 | 100,000 | 1,000,000
    --------+-----------+-----------+-----------+-----------+----------
    real | 0m00.153s | 0m00.589s | 0m05.601s | 0m56.691s | 9m59.128s
    user | 0m00.007s | 0m00.007s | 0m00.077s | 0m00.703s | 0m06.800s
    sys | 0m00.010s | 0m00.070s | 0m00.633s | 0m06.423s | 1m10.005s
    access | 3 | 1 | 1 | 4 | 31
    getattr | 2 | 1 | 1 | 1 | 1
    lookup | 104 | 1,003 | 10,003 | 100,003 | 1,000,003
    readdir | 2 | 16 | 158 | 1,575 | 15,749
    total | 111 | 1,021 | 10,163 | 101,583 | 1,015,784

    With readdir plus enabled, I see this:

    n files | 100 | 1,000 | 10,000 | 100,000 | 1,000,000
    --------+-----------+-----------+-----------+-----------+----------
    real | 0m00.115s | 0m00.206s | 0m01.079s | 0m12.521s | 2m07.528s
    user | 0m00.003s | 0m00.003s | 0m00.040s | 0m00.290s | 0m03.296s
    sys | 0m00.007s | 0m00.020s | 0m00.120s | 0m01.357s | 0m17.556s
    access | 3 | 1 | 1 | 1 | 7
    getattr | 2 | 1 | 1 | 1 | 1
    lookup | 4 | 3 | 3 | 3 | 3
    readdir | 6 | 62 | 630 | 6,300 | 62,993
    total | 15 | 67 | 635 | 6,305 | 63,004

    Readdir plus disabled has about a 16x increase in the number of rpc calls and
    is 4 - 5 times slower on large directories.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     
  • Getattr should be able to decode errors and the readdir file handle.
    decode_getfattr_attrs does the actual attribute decoding, while
    decode_getfattr_generic will check the opcode before decoding. This will
    let other functions call decode_getfattr_attrs to decode their attributes.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker