07 May, 2007

12 commits

  • Rewrite nlmsvc_testlock() to use the new asynchronous interface: instead of
    immediately doing a posix_test_lock(), we first look for a matching block.
    If the subsequent test_lock returns anything other than -EINPROGRESS, we
    then remove the block we've found and return the results.

    If it returns -EINPROGRESS, then we defer the lock request.

    In the case where the block we find in the first step has B_QUEUED set,
    we bypass the vfs_test_lock entirely, instead using the block to decide how
    to respond:
    with nlm_lck_denied if B_TIMED_OUT is set.
    with nlm_granted if B_GOT_CALLBACK is set.
    by dropping if neither B_TIMED_OUT nor B_GOT_CALLBACK is set

    Signed-off-by: Marc Eshel
    Signed-off-by: J. Bruce Fields

    Marc Eshel
     
  • Change NLM internal interface to pass more information for test lock; we
    need this to make sure the cookie information is pushed down to the place
    where we do request deferral, which is handled for testlock by the
    following patch.

    Signed-off-by: Marc Eshel
    Signed-off-by: J. Bruce Fields

    Marc Eshel
     
  • Add code to handle file system callback when the lock is finally granted.

    Signed-off-by: Marc Eshel
    Signed-off-by: J. Bruce Fields

    Marc Eshel
     
  • We need to keep some state for a pending asynchronous lock request, so this
    patch adds that state to struct nlm_block.

    This also adds a function which defers the request, by calling
    rqstp->rq_chandle.defer and storing the resulting deferred request in a
    nlm_block structure which we insert into lockd's global block list. That
    new function isn't called yet, so it's dead code until a later patch.

    Signed-off-by: Marc Eshel
    Signed-off-by: J. Bruce Fields

    Marc Eshel
     
  • Acquiring a lock on a cluster filesystem may require communication with
    remote hosts, and to avoid blocking lockd or nfsd threads during such
    communication, we allow the results to be returned asynchronously.

    When a ->lock() call needs to block, the file system will return
    -EINPROGRESS, and then later return the results with a call to the
    routine in the fl_grant field of the lock_manager_operations struct.

    This differs from the case when ->lock returns -EAGAIN to a blocking
    lock request; in that case, the filesystem calls fl_notify when the lock
    is granted, and the caller retries the original lock. So while
    fl_notify is merely a hint to the caller that it should retry, fl_grant
    actually communicates the final result of the lock operation (with the
    lock already acquired in the succesful case).

    Therefore fl_grant takes a lock, a status and, for the test lock case, a
    conflicting lock. We also allow fl_grant to return an error to the
    filesystem, to handle the case where the fl_grant requests arrives after
    the lock manager has already given up waiting for it.

    Signed-off-by: Marc Eshel
    Signed-off-by: J. Bruce Fields

    Marc Eshel
     
  • Convert NFSv4 to the new lock interface. We don't define any callback for now,
    so we're not taking advantage of the asynchronous feature--that's less critical
    for the multi-threaded nfsd then it is for the single-threaded lockd. But this
    does allow a cluster filesystems to export cluster-coherent locking to NFS.

    Note that it's cluster filesystems that are the issue--of the filesystems that
    define lock methods (nfs, cifs, etc.), most are not exportable by nfsd.

    Signed-off-by: Marc Eshel
    Signed-off-by: J. Bruce Fields

    Marc Eshel
     
  • Lock managers need to be able to cancel pending lock requests. In the case
    where the exported filesystem manages its own locks, it's not sufficient just
    to call posix_unblock_lock(); we need to let the filesystem know what's
    happening too.

    We do this by adding a new fcntl lock command: FL_CANCELLK. Some day this
    might also be made available to userspace applications that could benefit from
    an asynchronous locking api.

    Signed-off-by: Marc Eshel
    Signed-off-by: "J. Bruce Fields"

    Marc Eshel
     
  • The nfsv4 protocol's lock operation, in the case of a conflict, returns
    information about the conflicting lock.

    It's unclear how clients can use this, so for now we're not going so far as to
    add a filesystem method that can return a conflicting lock, but we may as well
    return something in the local case when it's easy to.

    Signed-off-by: Marc Eshel
    Signed-off-by: "J. Bruce Fields"

    Marc Eshel
     
  • Factor out the code that switches between generic and filesystem-specific lock
    methods; eventually we want to call this from lock managers (lockd and nfsd)
    too; currently they only call the generic methods.

    This patch does that for all the setlk code.

    Signed-off-by: Marc Eshel
    Signed-off-by: "J. Bruce Fields"

    Marc Eshel
     
  • Factor out the code that switches between generic and filesystem-specific lock
    methods; eventually we want to call this from lock managers (lockd and nfsd)
    too; currently they only call the generic methods.

    This patch does that for test_lock.

    Note that this hasn't been necessary until recently, because the few
    filesystems that define ->lock() (nfs, cifs...) aren't exportable via NFS.
    However GFS (and, in the future, other cluster filesystems) need to implement
    their own locking to get cluster-coherent locking, and also want to be able to
    export locking to NFS (lockd and NFSv4).

    So we accomplish this by factoring out code such as this and exporting it for
    the use of lockd and nfsd.

    Signed-off-by: "J. Bruce Fields"

    J. Bruce Fields
     
  • posix_test_lock() and ->lock() do the same job but have gratuitously
    different interfaces. Modify posix_test_lock() so the two agree,
    simplifying some code in the process.

    Signed-off-by: Marc Eshel
    Signed-off-by: "J. Bruce Fields"

    Marc Eshel
     
  • The file_lock argument to ->lock is used to return the conflicting lock
    when found. There's no reason for the filesystem to return any private
    information with this conflicting lock, but nfsv4 is.

    Fix nfsv4 client, and modify locks.c to stop calling fl_release_private
    for it in this case.

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

    J. Bruce Fields
     

17 Apr, 2007

2 commits


16 Apr, 2007

2 commits


15 Apr, 2007

8 commits


14 Apr, 2007

10 commits

  • 3w-xxxx emulates a REQUEST_SENSE response by simply returning nothing.
    Unfortunately, it's assuming that the REQUEST_SENSE command is
    implemented with use_sg == 0, which is no longer the case. The oops
    occurs because it's clearing the scatterlist in request_buffer instead
    of the memory region.

    This is fixed by using tw_transfer_internal() to transfer correctly to
    the scatterlist.

    Acked-by: adam radford
    Signed-off-by: James Bottomley

    James Bottomley
     
  • DVB USB remotes do not support changing keycode maps but set
    input_dev->keycodesize and input_dev->keycodemax without setting
    input_dev->keycode. This causes kernel oops when user tries to
    look up (or change) current keymap.

    While the proper fix would be to make remotes handle keymap changes
    we'll just remove keycodemax and keycodesize initialization so
    EVIOCGKEYCODE and EVIOCSKEYCODE will simply return -EINVAL.

    http://bugzilla.kernel.org/show_bug.cgi?id=8312

    Signed-off-by: olaf.kirch@oracle.com
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Linus Torvalds

    Olaf Kirch
     
  • * master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
    [SPARC64]: Fix inline directive in pci_iommu.c
    [SPARC64]: Fix arg passing to compat_sys_ipc().
    [SPARC]: Fix section mismatch warnings in pci.c and pcic.c
    [SUNRPC]: Make sure on-stack cmsg buffer is properly aligned.
    [SPARC]: avoid CHILD_MAX and OPEN_MAX constants
    [SPARC64]: Fix SBUS IOMMU allocation code.

    Linus Torvalds
     
  • * master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
    [NETFILTER] arp_tables: Fix unaligned accesses.
    [IPV6] SNMP: Fix {In,Out}NoRoutes statistics.
    [IPSEC] XFRM_USER: kernel panic when large security contexts in ACQUIRE
    [VLAN]: Allow VLAN interface on top of bridge interface
    [PKTGEN]: Add try_to_freeze()
    [NETFILTER]: ipt_ULOG: use put_unaligned

    Linus Torvalds
     
  • There are two device string comparison loops in arp_packet_match().
    The first one goes byte-by-byte but the second one tries to be
    clever and cast the string to a long and compare by longs.

    The device name strings in the arp table entries are not guarenteed
    to be aligned enough to make this value, so just use byte-by-byte
    for both cases.

    Based upon a report by .

    Signed-off-by: David S. Miller

    David S. Miller
     
  • A packet which is being discarded because of no routes in the
    forwarding path should not be counted as OutNoRoutes but as
    InNoRoutes.
    Additionally, on this occasion, a packet whose destinaion is
    not valid should be counted as InAddrErrors separately.

    Based on patch from Mitsuru Chinen .

    Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    YOSHIFUJI Hideaki
     
  • When sending a security context of 50+ characters in an ACQUIRE
    message, following kernel panic occurred.

    kernel BUG in xfrm_send_acquire at net/xfrm/xfrm_user.c:1781!
    cpu 0x3: Vector: 700 (Program Check) at [c0000000421bb2e0]
    pc: c00000000033b074: .xfrm_send_acquire+0x240/0x2c8
    lr: c00000000033b014: .xfrm_send_acquire+0x1e0/0x2c8
    sp: c0000000421bb560
    msr: 8000000000029032
    current = 0xc00000000fce8f00
    paca = 0xc000000000464b00
    pid = 2303, comm = ping
    kernel BUG in xfrm_send_acquire at net/xfrm/xfrm_user.c:1781!
    enter ? for help
    3:mon> t
    [c0000000421bb650] c00000000033538c .km_query+0x6c/0xec
    [c0000000421bb6f0] c000000000337374 .xfrm_state_find+0x7f4/0xb88
    [c0000000421bb7f0] c000000000332350 .xfrm_tmpl_resolve+0xc4/0x21c
    [c0000000421bb8d0] c0000000003326e8 .xfrm_lookup+0x1a0/0x5b0
    [c0000000421bba00] c0000000002e6ea0 .ip_route_output_flow+0x88/0xb4
    [c0000000421bbaa0] c0000000003106d8 .ip4_datagram_connect+0x218/0x374
    [c0000000421bbbd0] c00000000031bc00 .inet_dgram_connect+0xac/0xd4
    [c0000000421bbc60] c0000000002b11ac .sys_connect+0xd8/0x120
    [c0000000421bbd90] c0000000002d38d0 .compat_sys_socketcall+0xdc/0x214
    [c0000000421bbe30] c00000000000869c syscall_exit+0x0/0x40
    --- Exception: c00 (System Call) at 0000000007f0ca9c
    SP (fc0ef8f0) is in userspace

    We are using size of security context from xfrm_policy to determine
    how much space to alloc skb and then putting security context from
    xfrm_state into skb. Should have been using size of security context
    from xfrm_state to alloc skb. Following fix does that

    Signed-off-by: Joy Latten
    Acked-by: James Morris
    Signed-off-by: David S. Miller

    Joy Latten
     
  • When a VLAN interface is created on top of a bridge interface and
    netfilter is enabled to see the bridged packets, the packets can be
    corrupted when passing through the netfilter code. This is caused by the
    VLAN driver not setting the 'protocol' and 'nh' members of the sk_buff
    structure. In general, this is no problem as the VLAN interface is mostly
    connected to a physical ethernet interface which does not use the
    'protocol' and 'nh' members. For a bridge interface, however, these
    members do matter.

    Signed-off-by: Jerome Borsboom
    Signed-off-by: David S. Miller

    Jerome Borsboom
     
  • While building a test kernel for the new esp driver (against
    git-current), I hit this bug. Trivial fix, put the inline declaration
    in the right place. :)

    Signed-off-by: Tom "spot" Callaway
    Signed-off-by: David S. Miller

    Tom "spot" Callaway
     
  • Do not sign extend args using the sys32_ipc stub, that is
    buggy and unnecessary.

    Based upon an excellent report by Mikael Pettersson.

    Signed-off-by: David S. Miller

    David S. Miller
     

13 Apr, 2007

6 commits