13 Sep, 2010

4 commits

  • 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
     
  • Hi,

    An NFS client executes a statfs("file", &buff) call.
    "file" exists / existed, the client has read / written it,
    but it has already closed it.

    user_path(pathname, &path) looks up "file" successfully in the
    directory-cache and restarts the aging timer of the directory-entry.
    Even if "file" has already been removed from the server, because the
    lookupcache=positive option I use, keeps the entries valid for a while.

    nfs_statfs() returns ESTALE if "file" has already been removed from the
    server.

    If the user application repeats the statfs("file", &buff) call, we
    are stuck: "file" remains young forever in the directory-cache.

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

    Menyhart Zoltan
     
  • Reported-by: Ben Greear
    Signed-off-by: Trond Myklebust
    Cc: stable@kernel.org

    Trond Myklebust
     
  • The do_vfs_lock function on fs/nfs/file.c is only called if NLM is
    not being used, via the -onolock mount option. Therefore it cannot
    really be "out of sync with lock manager" when the local locking
    function called returns an error, as there will be no corresponding
    call to the NLM. For details, simply check the if/else on do_setlk
    and do_unlk on fs/nfs/file.c.

    Signed-Off-By: Fabio Olive Leite
    Reviewed-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Fabio Olive Leite
     

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

2 commits

  • Adam Lackorzynski reports:

    with 2.6.35.2 I'm getting this reproducible Oops:

    [ 110.825396] BUG: unable to handle kernel NULL pointer dereference at
    (null)
    [ 110.828638] IP: [] encode_attrs+0x1a/0x2a4
    [ 110.828638] PGD be89f067 PUD bf18f067 PMD 0
    [ 110.828638] Oops: 0000 [#1] SMP
    [ 110.828638] last sysfs file: /sys/class/net/lo/operstate
    [ 110.828638] CPU 2
    [ 110.828638] Modules linked in: rtc_cmos rtc_core rtc_lib amd64_edac_mod
    i2c_amd756 edac_core i2c_core dm_mirror dm_region_hash dm_log dm_snapshot
    sg sr_mod usb_storage ohci_hcd mptspi tg3 mptscsih mptbase usbcore nls_base
    [last unloaded: scsi_wait_scan]
    [ 110.828638]
    [ 110.828638] Pid: 11264, comm: setchecksum Not tainted 2.6.35.2 #1
    [ 110.828638] RIP: 0010:[] []
    encode_attrs+0x1a/0x2a4
    [ 110.828638] RSP: 0000:ffff88003bf5b878 EFLAGS: 00010296
    [ 110.828638] RAX: ffff8800bddb48a8 RBX: ffff88003bf5bb18 RCX:
    0000000000000000
    [ 110.828638] RDX: ffff8800be258800 RSI: 0000000000000000 RDI:
    ffff88003bf5b9f8
    [ 110.828638] RBP: 0000000000000000 R08: ffff8800bddb48a8 R09:
    0000000000000004
    [ 110.828638] R10: 0000000000000003 R11: ffff8800be779000 R12:
    ffff8800be258800
    [ 110.828638] R13: ffff88003bf5b9f8 R14: ffff88003bf5bb20 R15:
    ffff8800be258800
    [ 110.828638] FS: 0000000000000000(0000) GS:ffff880041e00000(0063)
    knlGS:00000000556bd6b0
    [ 110.828638] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
    [ 110.828638] CR2: 0000000000000000 CR3: 00000000be8ef000 CR4:
    00000000000006e0
    [ 110.828638] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
    0000000000000000
    [ 110.828638] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
    0000000000000400
    [ 110.828638] Process setchecksum (pid: 11264, threadinfo
    ffff88003bf5a000, task ffff88003f232210)
    [ 110.828638] Stack:
    [ 110.828638] 0000000000000000 ffff8800bfbcf920 0000000000000000
    0000000000000ffe
    [ 110.828638] 0000000000000000 0000000000000000 0000000000000000
    0000000000000000
    [ 110.828638] 0000000000000000 0000000000000000 0000000000000000
    0000000000000000
    [ 110.828638] Call Trace:
    [ 110.828638] [] ? nfs4_xdr_enc_setattr+0x90/0xb4
    [ 110.828638] [] ? call_transmit+0x1c3/0x24a
    [ 110.828638] [] ? __rpc_execute+0x78/0x22a
    [ 110.828638] [] ? rpc_run_task+0x21/0x2b
    [ 110.828638] [] ? rpc_call_sync+0x3d/0x5d
    [ 110.828638] [] ? _nfs4_do_setattr+0x11b/0x147
    [ 110.828638] [] ? nfs_init_locked+0x0/0x32
    [ 110.828638] [] ? ifind+0x4e/0x90
    [ 110.828638] [] ? nfs4_do_setattr+0x4b/0x6e
    [ 110.828638] [] ? nfs4_do_open+0x291/0x3a6
    [ 110.828638] [] ? nfs4_open_revalidate+0x63/0x14a
    [ 110.828638] [] ? nfs_open_revalidate+0xd7/0x161
    [ 110.828638] [] ? do_lookup+0x1a4/0x201
    [ 110.828638] [] ? link_path_walk+0x6a/0x9d5
    [ 110.828638] [] ? do_last+0x17b/0x58e
    [ 110.828638] [] ? do_filp_open+0x1bd/0x56e
    [ 110.828638] [] ? _atomic_dec_and_lock+0x30/0x48
    [ 110.828638] [] ? dput+0x37/0x152
    [ 110.828638] [] ? alloc_fd+0x69/0x10a
    [ 110.828638] [] ? do_sys_open+0x56/0x100
    [ 110.828638] [] ? ia32_sysret+0x0/0x5
    [ 110.828638] Code: 83 f1 01 e8 f5 ca ff ff 48 83 c4 50 5b 5d 41 5c c3 41
    57 41 56 41 55 49 89 fd 41 54 49 89 d4 55 48 89 f5 53 48 81 ec 18 01 00 00
    06 89 c2 83 e2 08 83 fa 01 19 db 83 e3 f8 83 c3 18 a8 01 8d
    [ 110.828638] RIP [] encode_attrs+0x1a/0x2a4
    [ 110.828638] RSP
    [ 110.828638] CR2: 0000000000000000
    [ 112.840396] ---[ end trace 95282e83fd77358f ]---

    We need to ensure that the O_EXCL flag is turned off if the user doesn't
    set O_CREAT.

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

    Trond Myklebust
     
  • 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
     

14 Aug, 2010

1 commit


13 Aug, 2010

1 commit


12 Aug, 2010

3 commits


11 Aug, 2010

3 commits

  • This is more kernel-ish, saves some space, and also allows us to
    expand the ops without breaking all the callers who are happy for the
    new members to be NULL.

    The few places which defined their own param types are changed to the
    new scheme (more which crept in recently fixed in following patches).

    Since we're touching them anyway, we change get() and set() to take a
    const struct kernel_param (which they really are). This causes some
    harmless warnings until we fix them (in following patches).

    To reduce churn, module_param_call creates the ops struct so the callers
    don't have to change (and casts the functions to reduce warnings).
    The modern version which takes an ops struct is called module_param_cb.

    Signed-off-by: Rusty Russell
    Reviewed-by: Takashi Iwai
    Tested-by: Phil Carmody
    Cc: "David S. Miller"
    Cc: Ville Syrjala
    Cc: Dmitry Torokhov
    Cc: Alessandro Rubini
    Cc: Michal Januszewski
    Cc: Trond Myklebust
    Cc: "J. Bruce Fields"
    Cc: Neil Brown
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-input@vger.kernel.org
    Cc: linux-fbdev-devel@lists.sourceforge.net
    Cc: linux-nfs@vger.kernel.org
    Cc: netdev@vger.kernel.org

    Rusty Russell
     
  • Running "cat /proc/mounts" fails to display the "lookupcache" option.
    This oversight cost me a bunch of wasted time recently.

    The following simple patch fixes it.

    CC: stable
    Signed-off-by: Patrick LoPresti
    Signed-off-by: Trond Myklebust

    Patrick J. LoPresti
     
  • * '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

2 commits

  • To obey NFS cache semantics, the client must verify the cached
    attributes when a file is opened. In most cases this is done by a call to
    d_validate as one of the last steps in path_walk.

    However for the root of a filesystem, d_validate is only ever called
    on the mounted-on filesystem (except when the path ends '.' or '..').
    So NFS has no chance to validate the attributes.

    So, in nfs_opendir, we revalidate the attributes if the opened
    directory is the mountpoint. This may cause double-validation for "."
    and ".." lookups, but that is better than missing regular /path/name
    lookups completely.

    Signed-off-by: NeilBrown
    Signed-off-by: Trond Myklebust

    Neil Brown
     
  • Signed-off-by: Al Viro

    Al Viro
     

08 Aug, 2010

1 commit

  • * 'nfs-for-2.6.36' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (42 commits)
    NFS: NFSv4.1 is no longer a "developer only" feature
    NFS: NFS_V4 is no longer an EXPERIMENTAL feature
    NFS: Fix /proc/mount for legacy binary interface
    NFS: Fix the locking in nfs4_callback_getattr
    SUNRPC: Defer deleting the security context until gss_do_free_ctx()
    SUNRPC: prevent task_cleanup running on freed xprt
    SUNRPC: Reduce asynchronous RPC task stack usage
    SUNRPC: Move the bound cred to struct rpc_rqst
    SUNRPC: Clean up of rpc_bindcred()
    SUNRPC: Move remaining RPC client related task initialisation into clnt.c
    SUNRPC: Ensure that rpc_exit() always wakes up a sleeping task
    SUNRPC: Make the credential cache hashtable size configurable
    SUNRPC: Store the hashtable size in struct rpc_cred_cache
    NFS: Ensure the AUTH_UNIX credcache is allocated dynamically
    NFS: Fix the NFS users of rpc_restart_call()
    SUNRPC: The function rpc_restart_call() should return success/failure
    NFSv4: Get rid of the bogus RPC_ASSASSINATED(task) checks
    NFSv4: Clean up the process of renewing the NFSv4 lease
    NFSv4.1: Handle NFS4ERR_DELAY on SEQUENCE correctly
    NFS: nfs_rename() should not have to flush out writebacks
    ...

    Linus Torvalds
     

07 Aug, 2010

4 commits


04 Aug, 2010

8 commits


02 Aug, 2010

2 commits

  • Currently MAY_ACCESS means that filesystems must check the permissions
    right then and not rely on cached results or the results of future
    operations on the object. This can be because of a call to sys_access() or
    because of a call to chdir() which needs to check search without relying on
    any future operations inside that dir. I plan to use MAY_ACCESS for other
    purposes in the security system, so I split the MAY_ACCESS and the
    MAY_CHDIR cases.

    Signed-off-by: Eric Paris
    Acked-by: Stephen D. Smalley
    Signed-off-by: James Morris

    Eric Paris
     
  • nfs_commit_inode() needs to be defined irrespectively of whether or not
    we are supporting NFSv3 and NFSv4.

    Allow the compiler to optimise away code in the NFSv2-only case by
    converting it into an inlined stub function.

    Reported-and-tested-by: Ingo Molnar
    Signed-off-by: Trond Myklebust
    Signed-off-by: Linus Torvalds

    Trond Myklebust
     

31 Jul, 2010

7 commits


19 Jul, 2010

1 commit

  • The current shrinker implementation requires the registered callback
    to have global state to work from. This makes it difficult to shrink
    caches that are not global (e.g. per-filesystem caches). Pass the shrinker
    structure to the callback so that users can embed the shrinker structure
    in the context the shrinker needs to operate on and get back to it in the
    callback via container_of().

    Signed-off-by: Dave Chinner
    Reviewed-by: Christoph Hellwig

    Dave Chinner