1. 17 3月, 2012 7 次提交
  2. 16 3月, 2012 19 次提交
  3. 15 3月, 2012 11 次提交
  4. 14 3月, 2012 3 次提交
    • X
      block: fix ioc leak in put_io_context · ff8c1474
      Xiaotian Feng 提交于
      When put_io_context is called, if ioc->icq_list is empty and refcount
      is 1, kernel will not free the ioc.
      
      This is caught by following kmemleak:
      
      unreferenced object 0xffff880036349fe0 (size 216):
        comm "sh", pid 2137, jiffies 4294931140 (age 290579.412s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          01 00 01 00 ad 4e ad de ff ff ff ff 00 00 00 00  .....N..........
        backtrace:
          [<ffffffff8169f926>] kmemleak_alloc+0x26/0x50
          [<ffffffff81195a9c>] kmem_cache_alloc_node+0x1cc/0x2a0
          [<ffffffff81356b67>] create_io_context_slowpath+0x27/0x130
          [<ffffffff81356d2b>] get_task_io_context+0xbb/0xf0
          [<ffffffff81055f0e>] copy_process+0x188e/0x18b0
          [<ffffffff8105609b>] do_fork+0x11b/0x420
          [<ffffffff810247f8>] sys_clone+0x28/0x30
          [<ffffffff816d3373>] stub_clone+0x13/0x20
          [<ffffffffffffffff>] 0xffffffffffffffff
      
      ioc should be freed if ioc->icq_list is empty.
      Signed-off-by: NXiaotian Feng <dannyfeng@tencent.com>
      Acked-by: NVivek Goyal <vgoyal@redhat.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      ff8c1474
    • N
      iscsi-target: Fix reservation conflict -EBUSY response handling bug · 00fdc6bb
      Nicholas Bellinger 提交于
      This patch addresses a iscsi-target specific bug related to reservation conflict
      handling in iscsit_handle_scsi_cmd() that has been causing reservation conflicts
      to complete and not fail as expected due to incorrect errno checking.  The problem
      occured with the change to return -EBUSY from transport_generic_cmd_sequencer() ->
      transport_generic_allocate_tasks() failures, that broke iscsit_handle_scsi_cmd()
      checking for -EINVAL in order to invoke a non GOOD status response.
      
      This was manifesting itself as data corruption with legacy SPC-2 reservations,
      but also effects iscsi-target LUNs with SPC-3 persistent reservations.
      
      This bug was originally introduced in lio-core commit:
      
      commit 03e98c9e
      Author: Nicholas Bellinger <nab@linux-iscsi.org>
      Date:   Fri Nov 4 02:36:16 2011 -0700
      
          target: Address legacy PYX_TRANSPORT_* return code breakage
      Reported-by: NMartin Svec <martin.svec@zoner.cz>
      Cc: Martin Svec <martin.svec@zoner.cz>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      00fdc6bb
    • N
      target: Fix compatible reservation handling (CRH=1) with legacy RESERVE/RELEASE · 087a03b3
      Nicholas Bellinger 提交于
      This patch addresses a bug with target_check_scsi2_reservation_conflict()
      return checking in target_scsi2_reservation_[reserve,release]() that was
      preventing CRH=1 operation from silently succeeding in the two special
      cases defined by SPC-3, and not failing with reservation conflict status
      when dealing with legacy RESERVE/RELEASE + active SPC-3 PR logic.
      
      Also explictly set cmd->scsi_status = SAM_STAT_RESERVATION_CONFLICT during
      the early non reservation holder failure from pr_ops->t10_seq_non_holder()
      check in transport_generic_cmd_sequencer() for fabrics that already expect
      it to be set.
      
      This bug was originally introduced in mainline commit:
      
      commit eacac00c
      Author: Christoph Hellwig <hch@infradead.org>
      Date:   Thu Nov 3 17:50:40 2011 -0400
      
          target: split core_scsi2_emulate_crh
      Reported-by: NMartin Svec <martin.svec@zoner.cz>
      Cc: Martin Svec <martin.svec@zoner.cz>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      087a03b3