13 Sep, 2010

1 commit

  • The NFSv4 client's callback server calls svc_gss_principal(), which
    is defined in the auth_rpcgss.ko

    The NFSv4 server has the same dependency, and in addition calls
    svcauth_gss_flavor(), gss_mech_get_by_pseudoflavor(),
    gss_pseudoflavor_to_service() and gss_mech_put() from the same module.

    The module auth_rpcgss itself has no dependencies aside from sunrpc,
    so we only need to select RPCSEC_GSS.

    Reported-by: Uwe Kleine-König
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

08 Sep, 2010

1 commit


03 Sep, 2010

1 commit


29 Aug, 2010

1 commit


27 Aug, 2010

5 commits


19 Aug, 2010

1 commit

  • * 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
    NFS: Fix an Oops in the NFSv4 atomic open code
    NFS: Fix the selection of security flavours in Kconfig
    NFS: fix the return value of nfs_file_fsync()
    rpcrdma: Fix SQ size calculation when memreg is FRMR
    xprtrdma: Do not truncate iova_start values in frmr registrations.
    nfs: Remove redundant NULL check upon kfree()
    nfs: Add "lookupcache" to displayed mount options
    NFS: allow close-to-open cache semantics to apply to root of NFS filesystem
    SUNRPC: fix NFS client over TCP hangs due to packet loss (Bug 16494)

    Linus Torvalds
     

18 Aug, 2010

1 commit

  • Randy Dunlap reports:

    ERROR: "svc_gss_principal" [fs/nfs/nfs.ko] undefined!

    because in fs/nfs/Kconfig, NFS_V4 selects RPCSEC_GSS_KRB5
    and/or in fs/nfsd/Kconfig, NFSD_V4 selects RPCSEC_GSS_KRB5.

    RPCSEC_GSS_KRB5 does 5 selects, but none of these is enforced/followed
    by the fs/nfs[d]/Kconfig configs:

    select SUNRPC_GSS
    select CRYPTO
    select CRYPTO_MD5
    select CRYPTO_DES
    select CRYPTO_CBC

    Reported-by: Randy Dunlap
    Cc: J. Bruce Fields
    Acked-by: Randy Dunlap
    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

11 Aug, 2010

2 commits

  • * 'for-linus' of git://git.infradead.org/users/eparis/notify: (132 commits)
    fanotify: use both marks when possible
    fsnotify: pass both the vfsmount mark and inode mark
    fsnotify: walk the inode and vfsmount lists simultaneously
    fsnotify: rework ignored mark flushing
    fsnotify: remove global fsnotify groups lists
    fsnotify: remove group->mask
    fsnotify: remove the global masks
    fsnotify: cleanup should_send_event
    fanotify: use the mark in handler functions
    audit: use the mark in handler functions
    dnotify: use the mark in handler functions
    inotify: use the mark in handler functions
    fsnotify: send fsnotify_mark to groups in event handling functions
    fsnotify: Exchange list heads instead of moving elements
    fsnotify: srcu to protect read side of inode and vfsmount locks
    fsnotify: use an explicit flag to indicate fsnotify_destroy_mark has been called
    fsnotify: use _rcu functions for mark list traversal
    fsnotify: place marks on object in order of group memory address
    vfs/fsnotify: fsnotify_close can delay the final work in fput
    fsnotify: store struct file not struct path
    ...

    Fix up trivial delete/modify conflict in fs/notify/inotify/inotify.c.

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (96 commits)
    no need for list_for_each_entry_safe()/resetting with superblock list
    Fix sget() race with failing mount
    vfs: don't hold s_umount over close_bdev_exclusive() call
    sysv: do not mark superblock dirty on remount
    sysv: do not mark superblock dirty on mount
    btrfs: remove junk sb_dirt change
    BFS: clean up the superblock usage
    AFFS: wait for sb synchronization when needed
    AFFS: clean up dirty flag usage
    cifs: truncate fallout
    mbcache: fix shrinker function return value
    mbcache: Remove unused features
    add f_flags to struct statfs(64)
    pass a struct path to vfs_statfs
    update VFS documentation for method changes.
    All filesystems that need invalidate_inode_buffers() are doing that explicitly
    convert remaining ->clear_inode() to ->evict_inode()
    Make ->drop_inode() just return whether inode needs to be dropped
    fs/inode.c:clear_inode() is gone
    fs/inode.c:evict() doesn't care about delete vs. non-delete paths now
    ...

    Fix up trivial conflicts in fs/nilfs2/super.c

    Linus Torvalds
     

10 Aug, 2010

1 commit

  • We'll need the path to implement the flags field for statvfs support.
    We do have it available in all callers except:

    - ecryptfs_statfs. This one doesn't actually need vfs_statfs but just
    needs to do a caller to the lower filesystem statfs method.
    - sys_ustat. Add a non-exported statfs_by_dentry helper for it which
    doesn't won't be able to fill out the flags field later on.

    In addition rename the helpers for statfs vs fstatfs to do_*statfs instead
    of the misleading vfs prefix.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

08 Aug, 2010

1 commit

  • * 'for-2.6.36' of git://linux-nfs.org/~bfields/linux: (34 commits)
    nfsd4: fix file open accounting for RDWR opens
    nfsd: don't allow setting maxblksize after svc created
    nfsd: initialize nfsd versions before creating svc
    net: sunrpc: removed duplicated #include
    nfsd41: Fix a crash when a callback is retried
    nfsd: fix startup/shutdown order bug
    nfsd: minor nfsd read api cleanup
    gcc-4.6: nfsd: fix initialized but not read warnings
    nfsd4: share file descriptors between stateid's
    nfsd4: fix openmode checking on IO using lock stateid
    nfsd4: miscellaneous process_open2 cleanup
    nfsd4: don't pretend to support write delegations
    nfsd: bypass readahead cache when have struct file
    nfsd: minor nfsd_svc() cleanup
    nfsd: move more into nfsd_startup()
    nfsd: just keep single lockd reference for nfsd
    nfsd: clean up nfsd_create_serv error handling
    nfsd: fix error handling in __write_ports_addxprt
    nfsd: fix error handling when starting nfsd with rpcbind down
    nfsd4: fix v4 state shutdown error paths
    ...

    Linus Torvalds
     

07 Aug, 2010

5 commits

  • Commit f9d7562fdb9dc0ada3a7aba5dbbe9d965e2a105d "nfsd4: share file
    descriptors between stateid's" didn't correctly account for O_RDWR opens.
    Symptoms include leaked files, resulting in failures to unmount and/or
    warnings about orphaned inodes on reboot.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • It's harmless to set this after the server is created, but also
    ineffective, since the value is only used at the time of
    svc_create_pooled(). So fail the attempt, in keeping with the pattern
    set by write_versions, write_{lease,grace}time and write_recoverydir.

    (This could break userspace that tried to write to nfsd/max_block_size
    between setting up sockets and starting the server. However, such code
    wouldn't have worked anyway, and I don't know of any examples--rpc.nfsd
    in nfs-utils, probably the only user of the interface, doesn't do that.)

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Commit 59db4a0c102e0de226a3395dbf25ea51bf845937 "nfsd: move more into
    nfsd_startup()" inadvertently moved nfsd_versions after
    nfsd_create_svc(). On older distributions using an rpc.nfsd that does
    not explicitly set the list of nfsd versions, this results in
    svc-create_pooled() being called with an empty versions array. The
    resulting incomplete initialization leads to a NULL dereference in
    svc_process_common() the first time a client accesses the server.

    Move nfsd_reset_versions() back before the svc_create_pooled(); this
    time, put it closer to the svc_create_pooled() call, to make this
    mistake more difficult in the future.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • If a callback is retried at nfsd4_cb_recall_done() due to
    some error, the returned rpc reply crashes here:

    @@ -514,6 +514,7 @@ decode_cb_sequence(struct xdr_stream *xdr, struct nfsd4_cb_sequence *res,
    u32 dummy;
    __be32 *p;

    + BUG_ON(!res);
    if (res->cbs_minorversion == 0)
    return 0;

    [BUG_ON added for demonstration]

    This is because the nfsd4_cb_done_sequence() has NULLed out
    the task->tk_msg.rpc_resp pointer.

    Also eventually the rpc would use the new slot without making
    sure it is free by calling nfsd41_cb_setup_sequence().

    This problem was introduced by a 4.1 protocol addition patch:
    [0421b5c5] nfsd41: Backchannel: Implement cb_recall over NFSv4.1

    Which was overlooking the possibility of an RPC callback retries.
    For not-4.1 case redoing the _prepare is harmless.

    Signed-off-by: Boaz Harrosh
    Signed-off-by: J. Bruce Fields

    Boaz Harrosh
     
  • We must create the server before we can call init_socks or check the
    number of threads.

    Symptoms were a NULL pointer dereference in nfsd_svc(). Problem
    identified by Jeff Layton.

    Also fix a minor cleanup-on-error case in nfsd_startup().

    Reported-by: Tetsuo Handa
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

31 Jul, 2010

1 commit


30 Jul, 2010

5 commits

  • Fixes at least one real minor bug: the nfs4 recovery dir sysctl
    would not return its status properly.

    Also I finished Al's 1e41568d7378d ("Take ima_path_check() in nfsd
    past dentry_open() in nfsd_open()") commit, it moved the IMA
    code, but left the old path initializer in there.

    The rest is just dead code removed I think, although I was not
    fully sure about the "is_borc" stuff. Some more review
    would be still good.

    Found by gcc 4.6's new warnings.

    Signed-off-by: Andi Kleen
    Cc: Al Viro
    Cc: Neil Brown
    Signed-off-by: Andrew Morton
    Signed-off-by: J. Bruce Fields

    Andi Kleen
     
  • The vfs doesn't really allow us to "upgrade" a file descriptor from
    read-only to read-write, and our attempt to do so in nfs4_upgrade_open
    is ugly and incomplete.

    Move to a different scheme where we keep multiple opens, shared between
    open stateid's, in the nfs4_file struct. Each file will be opened at
    most 3 times (for read, write, and read-write), and those opens will be
    shared between all clients and openers. On upgrade we will do another
    open if necessary instead of attempting to upgrade an existing open.
    We keep count of the number of readers and writers so we know when to
    close the shared files.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • It is legal to perform a write using the lock stateid that was
    originally associated with a read lock, or with a file that was
    originally opened for read, but has since been upgraded.

    So, when checking the openmode, check the mode associated with the
    open stateid from which the lock was derived.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Move more work into helper functions.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • The delegation code mostly pretends to support either read or write
    delegations. However, correct support for write delegations would
    require, for example, breaking of delegations (and/or implementation of
    cb_getattr) on stat. Currently all that stops us from handing out
    delegations is a subtle reference-counting issue.

    Avoid confusion by adding an earlier check that explicitly refuses write
    delegations.

    For now, though, I'm not going so far as to rip out existing
    half-support for write delegations, in case we get around to using that
    soon.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

28 Jul, 2010

2 commits

  • fanotify, the upcoming notification system actually needs a struct path so it can
    do opens in the context of listeners, and it needs a file so it can get f_flags
    from the original process. Close was the only operation that already was passing
    a struct file to the notification hook. This patch passes a file for access,
    modify, and open as well as they are easily available to these hooks.

    Signed-off-by: Eric Paris

    Eric Paris
     
  • The readahead cache compensates for the fact that the NFS server
    currently does an open and close on every IO operation in the NFSv2 and
    NFSv3 case.

    In the NFSv4 case we have long-lived struct files associated with client
    opens, so there's no need for this. In fact, concurrent IO's using
    trying to modify the same file->f_ra may cause problems.

    So, don't bother with the readahead cache in that case.

    Note eventually we'll likely do this in the v2/v3 case as well by
    keeping a cache of struct files instead of struct file_ra_state's.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

23 Jul, 2010

8 commits

  • More idiomatic to put the error case in the if clause.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • This is just cleanup--it's harmless to call nfsd_rachache_init,
    nfsd_init_socks, and nfsd_reset_versions more than once. But there's no
    point to it.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Right now, nfsd keeps a lockd reference for each socket that it has
    open. This is unnecessary and complicates the error handling on
    startup and shutdown. Change it to just do a lockd_up when starting
    the first nfsd thread just do a single lockd_down when taking down the
    last nfsd thread. Because of the strange way the sv_count is handled
    this requires an extra flag to tell whether the nfsd_serv holds a
    reference for lockd or not.

    Signed-off-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     
  • There doesn't seem to be any need to reset the nfssvc_boot time if the
    nfsd startup failed.

    Signed-off-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     
  • __write_ports_addxprt calls nfsd_create_serv. That increases the
    refcount of nfsd_serv (which is tracked in sv_nrthreads). The service
    only decrements the thread count on error, not on success like
    __write_ports_addfd does, so using this interface leaves the nfsd
    thread count high.

    Fix this by having this function call svc_destroy() on error to release
    the reference (and possibly to tear down the service) and simply
    decrement the refcount without tearing down the service on success.

    This makes the sv_threads handling work basically the same in both
    __write_ports_addxprt and __write_ports_addfd.

    Signed-off-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     
  • The refcounting for nfsd is a little goofy. What happens is that we
    create the nfsd RPC service, attach sockets to it but don't actually
    start the threads until someone writes to the "threads" procfile. To do
    this, __write_ports_addfd will create the nfsd service and then will
    decrement the refcount when exiting but won't actually destroy the
    service.

    This is fine when there aren't errors, but when there are this can
    cause later attempts to start nfsd to fail. nfsd_serv will be set,
    and that causes __write_versions to return EBUSY.

    Fix this by calling svc_destroy on nfsd_serv when this function is
    going to return error.

    Signed-off-by: Jeff Layton
    Signed-off-by: J. Bruce Fields

    Jeff Layton
     
  • If someone tries to shut down the laundry_wq while it isn't up it'll
    cause an oops.

    This can happen because write_ports can create a nfsd_svc before we
    really start the nfs server, and we may fail before the server is ever
    started.

    Also make sure state is shutdown on error paths in nfsd_svc().

    Use a common global nfsd_up flag instead of nfs4_init, and create common
    helper functions for nfsd start/shutdown, as there will be other work
    that we want done only when we the number of nfsd threads transitions
    between zero and nonzero.

    Signed-off-by: J. Bruce Fields

    Jeff Layton
     
  • Trivial cleanup, since "dest" is never used.

    Reported-by: Anshul Madan
    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     

08 Jul, 2010

1 commit

  • Some well-known NFSv3 clients drop their directory entry caches when
    they receive replies with no WCC data. Without this data, they
    employ extra READ, LOOKUP, and GETATTR requests to ensure their
    directory entry caches are up to date, causing performance to suffer
    needlessly.

    In order to return WCC data, our server has to have both the pre-op
    and the post-op attribute data on hand when a reply is XDR encoded.
    The pre-op data is filled in when the incoming fh is locked, and the
    post-op data is filled in when the fh is unlocked.

    Unfortunately, for REMOVE, RMDIR, MKNOD, and MKDIR, the directory fh
    is not unlocked until well after the reply has been XDR encoded. This
    means that encode_wcc_data() does not have wcc_data for the parent
    directory, so none is returned to the client after these operations
    complete.

    By unlocking the parent directory fh immediately after the internal
    operations for each NFS procedure is complete, the post-op data is
    filled in before XDR encoding starts, so it can be returned to the
    client properly.

    Signed-off-by: Chuck Lever
    Signed-off-by: J. Bruce Fields

    Chuck Lever
     

07 Jul, 2010

1 commit


25 Jun, 2010

2 commits