22 May, 2012

2 commits

  • …sty/linux-2.6-for-linus

    Pull virtio updates from Rusty Russell.

    * tag 'virtio-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
    virtio: fix typo in comment
    virtio-mmio: Devices parameter parsing
    virtio_blk: Drop unused request tracking list
    virtio-blk: Fix hot-unplug race in remove method
    virtio: Use ida to allocate virtio index
    virtio: balloon: separate out common code between remove and freeze functions
    virtio: balloon: drop restore_common()
    9p: disconnect channel when PCI device is removed
    virtio: update documentation to v0.9.5 of spec

    Linus Torvalds
     
  • When a virtio_9p pci device is being removed, we should close down any
    active channels and free up resources, we're not supposed to BUG() if there's
    still an open channel since it's a valid case when removing the PCI device.

    Otherwise, removing the PCI device with an open channel would cause the
    following BUG():

    [ 1184.671416] ------------[ cut here ]------------
    [ 1184.672057] kernel BUG at net/9p/trans_virtio.c:618!
    [ 1184.672057] invalid opcode: 0000 [#1] PREEMPT SMP
    [ 1184.672057] CPU 3
    [ 1184.672057] Pid: 5, comm: kworker/u:0 Tainted: G W 3.4.0-rc2-next-20120413-sasha-dirty #76
    [ 1184.672057] RIP: 0010:[] [] p9_virtio_remove+0x16/0x90
    [ 1184.672057] RSP: 0018:ffff88000d653ac0 EFLAGS: 00010202
    [ 1184.672057] RAX: ffffffff836bfb40 RBX: ffff88000c9b2148 RCX: ffff88000d658978
    [ 1184.672057] RDX: 0000000000000006 RSI: 0000000000000000 RDI: ffff880028868000
    [ 1184.672057] RBP: ffff88000d653ad0 R08: 0000000000000000 R09: 0000000000000000
    [ 1184.672057] R10: 0000000000000000 R11: 0000000000000001 R12: ffff880028868000
    [ 1184.672057] R13: ffffffff835aa7c0 R14: ffff880041630000 R15: ffff88000d653da0
    [ 1184.672057] FS: 0000000000000000(0000) GS:ffff880035a00000(0000) knlGS:0000000000000000
    [ 1184.672057] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    [ 1184.672057] CR2: 0000000001181000 CR3: 000000000eba1000 CR4: 00000000000406e0
    [ 1184.672057] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    x000000000117a190 *[ 1184.672057] DR3: 00000000000000**
    00 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    [ 1184.672057] Process kworker/u:0 (pid: 5, threadinfo ffff88000d652000, task ffff88000d658000)
    [ 1184.672057] Stack:
    [ 1184.672057] ffff880028868000 ffffffff836bfb40 ffff88000d653af0 ffffffff8193661b
    [ 1184.672057] ffff880028868008 ffffffff836bfb40 ffff88000d653b10 ffffffff81af1c81
    [ 1184.672057] ffff880028868068 ffff880028868008 ffff88000d653b30 ffffffff81af257a
    [ 1184.795301] Call Trace:
    [ 1184.795301] [] virtio_dev_remove+0x1b/0x60
    [ 1184.795301] [] __device_release_driver+0x81/0xd0
    [ 1184.795301] [] device_release_driver+0x2a/0x40
    [ 1184.795301] [] bus_remove_device+0x138/0x150
    [ 1184.795301] [] device_del+0x14d/0x1b0
    [ 1184.795301] [] device_unregister+0x48/0x60
    [ 1184.795301] [] unregister_virtio_device+0xd/0x10
    [ 1184.795301] [] virtio_pci_remove+0x2a/0x6c
    [ 1184.795301] [] pci_device_remove+0x4d/0x110
    [ 1184.795301] [] __device_release_driver+0x81/0xd0
    [ 1184.795301] [] device_release_driver+0x2a/0x40
    [ 1184.795301] [] bus_remove_device+0x138/0x150
    [ 1184.795301] [] device_del+0x14d/0x1b0
    [ 1184.795301] [] device_unregister+0x48/0x60
    [ 1184.795301] [] pci_stop_bus_device+0x6a/0x90
    [ 1184.795301] [] pci_stop_and_remove_bus_device+0x11/0x20
    [ 1184.795301] [] remove_callback+0x9/0x10
    [ 1184.795301] [] sysfs_schedule_callback_work+0x21/0x60
    [ 1184.795301] [] process_one_work+0x281/0x430
    [ 1184.795301] [] ? process_one_work+0x220/0x430
    [ 1184.795301] [] ? sysfs_read_file+0x1c0/0x1c0
    [ 1184.795301] [] worker_thread+0x1f3/0x320
    [ 1184.795301] [] ? manage_workers.clone.13+0x130/0x130
    [ 1184.795301] [] kthread+0xb2/0xc0
    [ 1184.795301] [] kernel_thread_helper+0x4/0x10
    [ 1184.795301] [] ? finish_task_switch+0x78/0xf0
    [ 1184.795301] [] ? retint_restore_args+0x13/0x13
    [ 1184.795301] [] ? kthread_flush_work_fn+0x10/0x10
    [ 1184.795301] [] ? gs_change+0x13/0x13
    [ 1184.795301] Code: c1 9e 0a 00 48 83 c4 08 5b c9 c3 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 54 49 89 fc 53 48 8b 9f a8 04 00 00 80 3b 00 74 0a 0b 0f 1f 84 00 00 00 00 00 48 8b 87 88 04 00 00 ff 50 30 31
    [ 1184.795301] RIP [] p9_virtio_remove+0x16/0x90
    [ 1184.795301] RSP
    [ 1184.952618] ---[ end trace a307b3ed40206b4c ]---

    Signed-off-by: Sasha Levin
    Signed-off-by: Rusty Russell

    Sasha Levin
     

16 Apr, 2012

1 commit


27 Feb, 2012

2 commits

  • When a Tclunk or Tremove request is flushed, the fid is not freed on the
    server.

    p9_client_clunk() should retry once on interrupt, then if interrupted
    again, leak the fid for the duration of the connection.

    p9_client_remove() should call p9_client_clunk() on interrupt
    instead of unconditionally destroying the fid.

    Signed-off-by: Jim Garlick
    Signed-off-by: Eric Van Hensbergen

    Jim Garlick
     
  • When a signal is received while sending a Tflush, the client,
    which has recursed into p9_client_rpc() while sending another request,
    should wait for Rflush as long as the transport is still up.

    Signed-off-by: Jim Garlick
    Signed-off-by: Eric Van Hensbergen

    Jim Garlick
     

12 Jan, 2012

1 commit


06 Jan, 2012

1 commit

  • Reduce object size by deduplicating formats.

    Use vsprintf extension %pV.
    Rename P9_DPRINTK uses to p9_debug, align arguments.
    Add function for _p9_debug and macro to add __func__.
    Add missing "\n"s to p9_debug uses.
    Remove embedded function names as p9_debug adds it.
    Remove P9_EPRINTK macro and convert use to pr_.
    Add and use pr_fmt and pr_.

    $ size fs/9p/built-in.o*
    text data bss dec hex filename
    62133 984 16000 79117 1350d fs/9p/built-in.o.new
    67342 984 16928 85254 14d06 fs/9p/built-in.o.old
    $ size net/9p/built-in.o*
    text data bss dec hex filename
    88792 4148 22024 114964 1c114 net/9p/built-in.o.new
    94072 4148 23232 121452 1da6c net/9p/built-in.o.old

    Signed-off-by: Joe Perches
    Signed-off-by: Eric Van Hensbergen

    Joe Perches
     

25 Oct, 2011

5 commits

  • This helps in more control over debugging.
    root@qemu-img-64:~# ls /pass/123
    ls: cannot access /pass/123: No such file or directory
    root@qemu-img-64:~# cat /sys/kernel/debug/tracing/trace
    # tracer: nop
    #
    # TASK-PID CPU# TIMESTAMP FUNCTION
    # | | | | |
    ls-1536 [001] 70.928584: 9p_protocol_dump: clnt 18446612132784021504 P9_TWALK(tag = 1)
    000: 16 00 00 00 6e 01 00 01 00 00 00 02 00 00 00 01
    010: 00 03 00 31 32 33 00 00 00 ff ff ff ff 00 00 00

    ls-1536 [001] 70.928587:
    => trace_9p_protocol_dump
    => p9pdu_finalize
    => p9_client_rpc
    => p9_client_walk
    => v9fs_vfs_lookup
    => d_alloc_and_lookup
    => walk_component
    => path_lookupat
    ls-1536 [000] 70.929696: 9p_protocol_dump: clnt 18446612132784021504 P9_RLERROR(tag = 1)
    000: 0b 00 00 00 07 01 00 02 00 00 00 4e 03 00 02 00
    010: 00 00 00 00 03 00 02 00 00 00 00 00 ff 43 00 00

    ls-1536 [000] 70.929697:
    => trace_9p_protocol_dump
    => p9_client_rpc
    => p9_client_walk
    => v9fs_vfs_lookup
    => d_alloc_and_lookup
    => walk_component
    => path_lookupat
    => do_path_lookup

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • Without this msize=4294967295 will result in a crash

    Signed-off-by: Dan Carpenter
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Dan Carpenter
     
  • Instead of saying all integer argument option should be listed in the beginning
    move integer parsing to each option type.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • We dereferenced "req->tc" and "req->rc" before checking for NULL.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Dan Carpenter
     
  • * remove lot of update to different data structure
    * add a seperate callback for zero copy request.
    * above makes non zero copy code path simpler
    * remove conditionalizing TREAD/TREADDIR/TWRITE in the zero copy path
    * Fix the dotu p9_check_errors with zero copy. Add sufficient doc around
    * Add support for both in and output buffers in zero copy callback
    * pin and unpin pages in the same context
    * use helpers instead of defining page offset and rest of page ourself
    * Fix mem leak in p9_check_errors
    * Remove 'E' and 'F' in p9pdu_vwritef

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     

06 Sep, 2011

1 commit


23 Jul, 2011

9 commits


27 May, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
    RDMA/cma: Save PID of ID's owner
    RDMA/cma: Add support for netlink statistics export
    RDMA/cma: Pass QP type into rdma_create_id()
    RDMA: Update exported headers list
    RDMA/cma: Export enum cma_state in
    RDMA/nes: Add a check for strict_strtoul()
    RDMA/cxgb3: Don't post zero-byte read if endpoint is going away
    RDMA/cxgb4: Use completion objects for event blocking
    IB/srp: Fix integer -> pointer cast warnings
    IB: Add devnode methods to cm_class and umad_class
    IB/mad: Return EPROTONOSUPPORT when an RDMA device lacks the QP required
    IB/uverbs: Add devnode method to set path/mode
    RDMA/ucma: Add .nodename/.mode to tell userspace where to create device node
    RDMA: Add netlink infrastructure
    RDMA: Add error handling to ib_core_init()

    Linus Torvalds
     

26 May, 2011

1 commit

  • The RDMA CM currently infers the QP type from the port space selected
    by the user. In the future (eg with RDMA_PS_IB or XRC), there may not
    be a 1-1 correspondence between port space and QP type. For netlink
    export of RDMA CM state, we want to export the QP type to userspace,
    so it is cleaner to explicitly associate a QP type to an ID.

    Modify rdma_create_id() to allow the user to specify the QP type, and
    use it to make our selections of datagram versus connected mode.

    Signed-off-by: Sean Hefty
    Signed-off-by: Roland Dreier

    Sean Hefty
     

25 May, 2011

5 commits


21 May, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1446 commits)
    macvlan: fix panic if lowerdev in a bond
    tg3: Add braces around 5906 workaround.
    tg3: Fix NETIF_F_LOOPBACK error
    macvlan: remove one synchronize_rcu() call
    networking: NET_CLS_ROUTE4 depends on INET
    irda: Fix error propagation in ircomm_lmp_connect_response()
    irda: Kill set but unused variable 'bytes' in irlan_check_command_param()
    irda: Kill set but unused variable 'clen' in ircomm_connect_indication()
    rxrpc: Fix set but unused variable 'usage' in rxrpc_get_transport()
    be2net: Kill set but unused variable 'req' in lancer_fw_download()
    irda: Kill set but unused vars 'saddr' and 'daddr' in irlan_provider_connect_indication()
    atl1c: atl1c_resume() is only used when CONFIG_PM_SLEEP is defined.
    rxrpc: Fix set but unused variable 'usage' in rxrpc_get_peer().
    rxrpc: Kill set but unused variable 'local' in rxrpc_UDP_error_handler()
    rxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection()
    rxrpc: Kill set but unused variable 'sp' in rxrpc_rotate_tx_window()
    pkt_sched: Kill set but unused variable 'protocol' in tc_classify()
    isdn: capi: Use pr_debug() instead of ifdefs.
    tg3: Update version to 3.119
    tg3: Apply rx_discards fix to 5719/5720
    ...

    Fix up trivial conflicts in arch/x86/Kconfig and net/mac80211/agg-tx.c
    as per Davem.

    Linus Torvalds
     

20 May, 2011

2 commits


13 May, 2011

1 commit

  • When p9pdu_readf() is called with "s" attribute, it allocates a pointer that
    will store a string. In p9dirent_read(), this pointer is not being released,
    leading to out of memory errors.
    This patch releases this pointer after string is copyed to dirent->d_name.

    Signed-off-by: Pedro Scarapicchia Junior
    Signed-off-by: Eric Van Hensbergen

    Pedro Scarapicchia Junior
     

10 May, 2011

1 commit


16 Apr, 2011

3 commits


13 Apr, 2011

1 commit


31 Mar, 2011

1 commit


23 Mar, 2011

1 commit

  • Recent zerocopy work in the 9P VirtIO transport maps and pins
    user buffers into kernel memory for the server to work on them.
    Since the user process can initiate this kind of pinning with a simple
    read/write call, thousands of IO threads initiated by the user process can
    hog the system resources and could result into denial of service.

    This patch introduces flow control to avoid that extreme scenario.

    The ceiling limit to avoid denial of service attacks is set to relatively
    high (nr_free_pagecache_pages()/4) so that it won't interfere with
    regular usage, but can step in extreme cases to limit the total system
    hang. Since we don't have a global structure to accommodate this variable,
    I choose the virtio_chan as the home for this.

    Signed-off-by: Venkateswararao Jujjuri
    Reviewed-by: Badari Pulavarty
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)