1. 23 9月, 2009 1 次提交
  2. 12 9月, 2009 1 次提交
  3. 11 7月, 2009 1 次提交
    • F
      block: fix sg SG_DXFER_TO_FROM_DEV regression · ecb554a8
      FUJITA Tomonori 提交于
      I overlooked SG_DXFER_TO_FROM_DEV support when I converted sg to use
      the block layer mapping API (2.6.28).
      
      Douglas Gilbert explained SG_DXFER_TO_FROM_DEV:
      
      http://www.spinics.net/lists/linux-scsi/msg37135.html
      
      =
      The semantics of SG_DXFER_TO_FROM_DEV were:
         - copy user space buffer to kernel (LLD) buffer
         - do SCSI command which is assumed to be of the DATA_IN
           (data from device) variety. This would overwrite
           some or all of the kernel buffer
         - copy kernel (LLD) buffer back to the user space.
      
      The idea was to detect short reads by filling the original
      user space buffer with some marker bytes ("0xec" it would
      seem in this report). The "resid" value is a better way
      of detecting short reads but that was only added this century
      and requires co-operation from the LLD.
      =
      
      This patch changes the block layer mapping API to support this
      semantics. This simply adds another field to struct rq_map_data and
      enables __bio_copy_iov() to copy data from user space even with READ
      requests.
      
      It's better to add the flags field and kills null_mapped and the new
      from_user fields in struct rq_map_data but that approach makes it
      difficult to send this patch to stable trees because st and osst
      drivers use struct rq_map_data (they were converted to use the block
      layer in 2.6.29 and 2.6.30). Well, I should clean up the block layer
      mapping API.
      
      zhou sf reported this regiression and tested this patch:
      
      http://www.spinics.net/lists/linux-scsi/msg37128.html
      http://www.spinics.net/lists/linux-scsi/msg37168.htmlReported-by: Nzhou sf <sxzzsf@gmail.com>
      Tested-by: Nzhou sf <sxzzsf@gmail.com>
      Cc: stable@kernel.org
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      ecb554a8
  4. 09 7月, 2009 1 次提交
  5. 01 7月, 2009 1 次提交
    • J
      block: get rid of queue-private command filter · 018e0446
      Jens Axboe 提交于
      The initial patches to support this through sysfs export were broken
      and have been if 0'ed out in any release. So lets just kill the code
      and reclaim some space in struct request_queue, if anyone would later
      like to fixup the sysfs bits, the git history can easily restore
      the removed bits.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      018e0446
  6. 23 5月, 2009 1 次提交
  7. 11 5月, 2009 1 次提交
    • T
      block: add rq->resid_len · c3a4d78c
      Tejun Heo 提交于
      rq->data_len served two purposes - the length of data buffer on issue
      and the residual count on completion.  This duality creates some
      headaches.
      
      First of all, block layer and low level drivers can't really determine
      what rq->data_len contains while a request is executing.  It could be
      the total request length or it coulde be anything else one of the
      lower layers is using to keep track of residual count.  This
      complicates things because blk_rq_bytes() and thus
      [__]blk_end_request_all() relies on rq->data_len for PC commands.
      Drivers which want to report residual count should first cache the
      total request length, update rq->data_len and then complete the
      request with the cached data length.
      
      Secondly, it makes requests default to reporting full residual count,
      ie. reporting that no data transfer occurred.  The residual count is
      an exception not the norm; however, the driver should clear
      rq->data_len to zero to signify the normal cases while leaving it
      alone means no data transfer occurred at all.  This reverse default
      behavior complicates code unnecessarily and renders block PC on some
      drivers (ide-tape/floppy) unuseable.
      
      This patch adds rq->resid_len which is used only for residual count.
      
      While at it, remove now unnecessasry blk_rq_bytes() caching in
      ide_pc_intr() as rq->data_len is not changed anymore.
      
      Boaz	: spotted missing conversion in osd
      Sergei	: spotted too early conversion to blk_rq_bytes() in ide-tape
      
      [ Impact: cleanup residual count handling, report 0 resid by default ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Cc: Borislav Petkov <petkovbb@googlemail.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Doug Gilbert <dgilbert@interlog.com>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Darrick J. Wong <djwong@us.ibm.com>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      c3a4d78c
  8. 27 4月, 2009 1 次提交
  9. 16 4月, 2009 1 次提交
  10. 03 4月, 2009 2 次提交
  11. 16 3月, 2009 1 次提交
    • J
      Rationalize fasync return values · 60aa4924
      Jonathan Corbet 提交于
      Most fasync implementations do something like:
      
           return fasync_helper(...);
      
      But fasync_helper() will return a positive value at times - a feature used
      in at least one place.  Thus, a number of other drivers do:
      
           err = fasync_helper(...);
           if (err < 0)
                   return err;
           return 0;
      
      In the interests of consistency and more concise code, it makes sense to
      map positive return values onto zero where ->fasync() is called.
      
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      60aa4924
  12. 13 3月, 2009 6 次提交
  13. 11 2月, 2009 1 次提交
  14. 03 1月, 2009 2 次提交
  15. 02 11月, 2008 1 次提交
    • A
      saner FASYNC handling on file close · 233e70f4
      Al Viro 提交于
      As it is, all instances of ->release() for files that have ->fasync()
      need to remember to evict file from fasync lists; forgetting that
      creates a hole and we actually have a bunch that *does* forget.
      
      So let's keep our lives simple - let __fput() check FASYNC in
      file->f_flags and call ->fasync() there if it's been set.  And lose that
      crap in ->release() instances - leaving it there is still valid, but we
      don't have to bother anymore.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      233e70f4
  16. 21 10月, 2008 1 次提交
  17. 17 10月, 2008 1 次提交
  18. 09 10月, 2008 13 次提交
  19. 27 8月, 2008 2 次提交
    • F
      sg: restore command permission for TYPE_SCANNER · 14e507b8
      FUJITA Tomonori 提交于
      sg allowed any command for TYPE_SCANNER. The cmd_filter patchset
      doesn't. We can't change sg's permission since it might break the
      existing software.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      14e507b8
    • F
      block: move cmdfilter from gendisk to request_queue · abf54393
      FUJITA Tomonori 提交于
      cmd_filter works only for the block layer SG_IO with SCSI block
      devices. It breaks scsi/sg.c, bsg, and the block layer SG_IO with SCSI
      character devices (such as st). We hit a kernel crash with them.
      
      The problem is that cmd_filter code accesses to gendisk (having struct
      blk_scsi_cmd_filter) via inode->i_bdev->bd_disk. It works for only
      SCSI block device files. With character device files, inode->i_bdev
      leads you to struct cdev. inode->i_bdev->bd_disk->blk_scsi_cmd_filter
      isn't safe.
      
      SCSI ULDs don't expose gendisk; they keep it private. bsg needs to be
      independent on any protocols. We shouldn't change ULDs to expose their
      gendisk.
      
      This patch moves struct blk_scsi_cmd_filter from gendisk to
      request_queue, a common object, which eveyone can access to.
      
      The user interface doesn't change; users can change the filters via
      /sys/block/. gendisk has a pointer to request_queue so the cmd_filter
      code accesses to struct blk_scsi_cmd_filter.
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      abf54393
  20. 05 8月, 2008 1 次提交