1. 12 10月, 2012 1 次提交
    • S
      9P: Fix race between p9_write_work() and p9_fd_request() · 759f4298
      Simon Derr 提交于
      Race scenario:
      
      thread A			thread B
      
      p9_write_work()                p9_fd_request()
      
      if (list_empty
        (&m->unsent_req_list))
        ...
      
                                     spin_lock(&client->lock);
                                     req->status = REQ_STATUS_UNSENT;
                                     list_add_tail(..., &m->unsent_req_list);
                                     spin_unlock(&client->lock);
                                     ....
                                     if (n & POLLOUT &&
                                     !test_and_set_bit(Wworksched, &m->wsched)
                                     schedule_work(&m->wq);
                                     --> not done because Wworksched is set
      
        clear_bit(Wworksched, &m->wsched);
        return;
      
      --> nobody will take care of sending the new request.
      
      This is not very likely to happen though, because p9_write_work()
      being called with an empty unsent_req_list is not frequent.
      But this also means that taking the lock earlier will not be costly.
      Signed-off-by: NSimon Derr <simon.derr@bull.net>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      759f4298
  2. 27 9月, 2012 1 次提交
  3. 18 9月, 2012 3 次提交
  4. 07 9月, 2012 1 次提交
    • S
      net/9p: Check errno validity · 43def35c
      Simon Derr 提交于
      While working on a modified server I had the Linux clients crash
      a few times. This lead me to find this:
      
      Some error codes are directly extracted from the server replies.
      A malformed server reply could contain an invalid error code, with a
      very large value. If this value is then passed to ERR_PTR() it will
      not be properly detected as an error code by IS_ERR() and as a result
      the kernel will dereference an invalid pointer.
      
      This patch tries to avoid this.
      Signed-off-by: NSimon Derr <simon.derr@bull.net>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      43def35c
  5. 21 8月, 2012 1 次提交
    • T
      workqueue: deprecate flush[_delayed]_work_sync() · 43829731
      Tejun Heo 提交于
      flush[_delayed]_work_sync() are now spurious.  Mark them deprecated
      and convert all users to flush[_delayed]_work().
      
      If you're cc'd and wondering what's going on: Now all workqueues are
      non-reentrant and the regular flushes guarantee that the work item is
      not pending or running on any CPU on return, so there's no reason to
      use the sync flushes at all and they're going away.
      
      This patch doesn't make any functional difference.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Mattia Dongili <malattia@linux.it>
      Cc: Kent Yoder <key@linux.vnet.ibm.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Karsten Keil <isdn@linux-pingi.de>
      Cc: Bryan Wu <bryan.wu@canonical.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Alasdair Kergon <agk@redhat.com>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: linux-wireless@vger.kernel.org
      Cc: Anton Vorontsov <cbou@mail.ru>
      Cc: Sangbeom Kim <sbkim73@samsung.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Petr Vandrovec <petr@vandrovec.name>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Avi Kivity <avi@redhat.com> 
      43829731
  6. 11 7月, 2012 1 次提交
  7. 28 6月, 2012 1 次提交
  8. 11 6月, 2012 1 次提交
  9. 05 6月, 2012 1 次提交
  10. 04 6月, 2012 1 次提交
    • J
      net: Remove casts to same type · e3192690
      Joe Perches 提交于
      Adding casts of objects to the same type is unnecessary
      and confusing for a human reader.
      
      For example, this cast:
      
      	int y;
      	int *p = (int *)&y;
      
      I used the coccinelle script below to find and remove these
      unnecessary casts.  I manually removed the conversions this
      script produces of casts with __force and __user.
      
      @@
      type T;
      T *p;
      @@
      
      -	(T *)p
      +	p
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e3192690
  11. 22 5月, 2012 1 次提交
    • S
      9p: disconnect channel when PCI device is removed · 991ad9ec
      Sasha Levin 提交于
      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:[<ffffffff825c9116>]  [<ffffffff825c9116>] 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]  [<ffffffff8193661b>] virtio_dev_remove+0x1b/0x60
      [ 1184.795301]  [<ffffffff81af1c81>] __device_release_driver+0x81/0xd0
      [ 1184.795301]  [<ffffffff81af257a>] device_release_driver+0x2a/0x40
      [ 1184.795301]  [<ffffffff81af0d48>] bus_remove_device+0x138/0x150
      [ 1184.795301]  [<ffffffff81aef08d>] device_del+0x14d/0x1b0
      [ 1184.795301]  [<ffffffff81aef138>] device_unregister+0x48/0x60
      [ 1184.795301]  [<ffffffff8193694d>] unregister_virtio_device+0xd/0x10
      [ 1184.795301]  [<ffffffff8265fc74>] virtio_pci_remove+0x2a/0x6c
      [ 1184.795301]  [<ffffffff818a95ad>] pci_device_remove+0x4d/0x110
      [ 1184.795301]  [<ffffffff81af1c81>] __device_release_driver+0x81/0xd0
      [ 1184.795301]  [<ffffffff81af257a>] device_release_driver+0x2a/0x40
      [ 1184.795301]  [<ffffffff81af0d48>] bus_remove_device+0x138/0x150
      [ 1184.795301]  [<ffffffff81aef08d>] device_del+0x14d/0x1b0
      [ 1184.795301]  [<ffffffff81aef138>] device_unregister+0x48/0x60
      [ 1184.795301]  [<ffffffff818a36fa>] pci_stop_bus_device+0x6a/0x90
      [ 1184.795301]  [<ffffffff818a3791>] pci_stop_and_remove_bus_device+0x11/0x20
      [ 1184.795301]  [<ffffffff818c21d9>] remove_callback+0x9/0x10
      [ 1184.795301]  [<ffffffff81252d91>] sysfs_schedule_callback_work+0x21/0x60
      [ 1184.795301]  [<ffffffff810cb1a1>] process_one_work+0x281/0x430
      [ 1184.795301]  [<ffffffff810cb140>] ? process_one_work+0x220/0x430
      [ 1184.795301]  [<ffffffff81252d70>] ? sysfs_read_file+0x1c0/0x1c0
      [ 1184.795301]  [<ffffffff810cc613>] worker_thread+0x1f3/0x320
      [ 1184.795301]  [<ffffffff810cc420>] ? manage_workers.clone.13+0x130/0x130
      [ 1184.795301]  [<ffffffff810d30b2>] kthread+0xb2/0xc0
      [ 1184.795301]  [<ffffffff826783f4>] kernel_thread_helper+0x4/0x10
      [ 1184.795301]  [<ffffffff810deb18>] ? finish_task_switch+0x78/0xf0
      [ 1184.795301]  [<ffffffff82676574>] ? retint_restore_args+0x13/0x13
      [ 1184.795301]  [<ffffffff810d3000>] ? kthread_flush_work_fn+0x10/0x10
      [ 1184.795301]  [<ffffffff826783f0>] ? 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 <0f> 0b 0f 1f 84 00 00 00 00 00 48 8b 87 88 04 00 00 ff 50 30 31
      [ 1184.795301] RIP  [<ffffffff825c9116>] p9_virtio_remove+0x16/0x90
      [ 1184.795301]  RSP <ffff88000d653ac0>
      [ 1184.952618] ---[ end trace a307b3ed40206b4c ]---
      Signed-off-by: NSasha Levin <levinsasha928@gmail.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      991ad9ec
  12. 16 4月, 2012 1 次提交
  13. 27 2月, 2012 2 次提交
  14. 12 1月, 2012 1 次提交
  15. 06 1月, 2012 1 次提交
    • J
      9p: Reduce object size with CONFIG_NET_9P_DEBUG · 5d385153
      Joe Perches 提交于
      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_<level>.
      Add and use pr_fmt and pr_<level>.
      
      $ 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: NJoe Perches <joe@perches.com>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      5d385153
  16. 25 10月, 2011 5 次提交
  17. 06 9月, 2011 1 次提交
  18. 23 7月, 2011 9 次提交
  19. 26 5月, 2011 1 次提交
    • S
      RDMA/cma: Pass QP type into rdma_create_id() · b26f9b99
      Sean Hefty 提交于
      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: NSean Hefty <sean.hefty@intel.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      b26f9b99
  20. 25 5月, 2011 5 次提交
  21. 20 5月, 2011 1 次提交