All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] scsi/dm: dm_blk_ioctl(): implement failover for SG_IO on dm-multipath
@ 2021-06-28  9:52 ` mwilck
  0 siblings, 0 replies; 37+ messages in thread
From: mwilck @ 2021-06-28  9:52 UTC (permalink / raw)
  To: Mike Snitzer, Alasdair G Kergon, Bart Van Assche,
	Martin K. Petersen, linux-scsi, dm-devel, Hannes Reinecke
  Cc: Daniel Wagner, linux-block, Paolo Bonzini, Christoph Hellwig,
	Benjamin Marzinski, nkoenig, emilne, Martin Wilck

From: Martin Wilck <mwilck@suse.com>

Hello Mike, hello Martin,

here is v4 of my attempt to add retry logic to SG_IO on dm-multipath devices.

Regards
Martin

Changes v3->v4 (thanks to Mike Snitzer):

 - Added an additional helper function sg_io_to_blk_status() to
   scsi_ioctl.c, in order to avoid open-coding handling of the SCSI result
   code in device-mapper.

 - Added a new method dm_sg_io_ioctl_fn() in struct target_type, define
   only by the multipath target. This allows moving the bulk of the new
   code to dm-mpath.c, and avoids the wrong limitation of the code to
   request-based multipath.

Changes v2->v3:

 - un-inlined scsi_result_to_blk_status again, and move the helper
   __scsi_result_to_blk_status to block/scsi_ioctl.c instead
   (Bart v. Assche)
 - open-coded the status/msg/host/driver-byte -> result conversion
   where the standard SCSI helpers aren't usable (Bart v. Assche)
    
Changes v1->v2:

 - applied modifications from Mike Snitzer
 - moved SG_IO dependent code to a separate file, no scsi includes in
   dm.c any more
 - made the new code depend on a configuration option 
 - separated out scsi changes, made scsi_result_to_blk_status()
   inline to avoid dependency of dm_mod from scsi_mod (Paolo Bonzini)

Martin Wilck (3):
  scsi: scsi_ioctl: export __scsi_result_to_blk_status()
  scsi: scsi_ioctl: add sg_io_to_blk_status()
  dm mpath: add CONFIG_DM_MULTIPATH_SG_IO - failover for SG_IO

 block/scsi_ioctl.c            |  72 ++++++++++++++++++++++-
 drivers/md/Kconfig            |  11 ++++
 drivers/md/dm-core.h          |   5 ++
 drivers/md/dm-mpath.c         | 105 ++++++++++++++++++++++++++++++++++
 drivers/md/dm.c               |  26 ++++++++-
 drivers/scsi/scsi_lib.c       |  24 +-------
 include/linux/blkdev.h        |   4 ++
 include/linux/device-mapper.h |   8 ++-
 8 files changed, 226 insertions(+), 29 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 37+ messages in thread
* Re: [PATCH v4 2/3] scsi: scsi_ioctl: add sg_io_to_blk_status()
  2021-06-28  9:52   ` [dm-devel] " mwilck
  (?)
  (?)
@ 2021-06-29  7:00 ` Dan Carpenter
  -1 siblings, 0 replies; 37+ messages in thread
From: kernel test robot @ 2021-06-28 16:06 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3955 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210628095210.26249-3-mwilck@suse.com>
References: <20210628095210.26249-3-mwilck@suse.com>
TO: mwilck(a)suse.com
TO: Mike Snitzer <snitzer@redhat.com>
TO: Alasdair G Kergon <agk@redhat.com>
TO: Bart Van Assche <Bart.VanAssche@sandisk.com>
TO: "Martin K. Petersen" <martin.petersen@oracle.com>
TO: linux-scsi(a)vger.kernel.org
TO: dm-devel(a)redhat.com
TO: Hannes Reinecke <hare@suse.de>
CC: Daniel Wagner <dwagner@suse.de>
CC: linux-block(a)vger.kernel.org
CC: Paolo Bonzini <pbonzini@redhat.com>

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on scsi/for-next next-20210628]
[cannot apply to dm/for-next block/for-next song-md/md-next v5.13]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/mwilck-suse-com/scsi-dm-dm_blk_ioctl-implement-failover-for-SG_IO-on-dm-multipath/20210628-175410
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago
config: xtensa-randconfig-s032-20210628 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/259453ca972ae531cfdca07cbf4d6bb09b8f8c9f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review mwilck-suse-com/scsi-dm-dm_blk_ioctl-implement-failover-for-SG_IO-on-dm-multipath/20210628-175410
        git checkout 259453ca972ae531cfdca07cbf4d6bb09b8f8c9f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=xtensa SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> block/scsi_ioctl.c:937:24: sparse: sparse: dubious: !x & y

vim +937 block/scsi_ioctl.c

45bac7756930b1 Martin Wilck 2021-06-28  931  
259453ca972ae5 Martin Wilck 2021-06-28  932  blk_status_t sg_io_to_blk_status(struct sg_io_hdr *hdr)
259453ca972ae5 Martin Wilck 2021-06-28  933  {
259453ca972ae5 Martin Wilck 2021-06-28  934  	int result;
259453ca972ae5 Martin Wilck 2021-06-28  935  	blk_status_t sts;
259453ca972ae5 Martin Wilck 2021-06-28  936  
259453ca972ae5 Martin Wilck 2021-06-28 @937  	if (!hdr->info & SG_INFO_CHECK)
259453ca972ae5 Martin Wilck 2021-06-28  938  		return BLK_STS_OK;
259453ca972ae5 Martin Wilck 2021-06-28  939  
259453ca972ae5 Martin Wilck 2021-06-28  940  	result = hdr->status |
259453ca972ae5 Martin Wilck 2021-06-28  941  		(hdr->msg_status << 8) |
259453ca972ae5 Martin Wilck 2021-06-28  942  		(hdr->host_status << 16) |
259453ca972ae5 Martin Wilck 2021-06-28  943  		(hdr->driver_status << 24);
259453ca972ae5 Martin Wilck 2021-06-28  944  
259453ca972ae5 Martin Wilck 2021-06-28  945  	sts = __scsi_result_to_blk_status(&result, result);
259453ca972ae5 Martin Wilck 2021-06-28  946  	hdr->host_status = host_byte(result);
259453ca972ae5 Martin Wilck 2021-06-28  947  
259453ca972ae5 Martin Wilck 2021-06-28  948  	return sts;
259453ca972ae5 Martin Wilck 2021-06-28  949  }
259453ca972ae5 Martin Wilck 2021-06-28  950  EXPORT_SYMBOL(sg_io_to_blk_status);
259453ca972ae5 Martin Wilck 2021-06-28  951  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29386 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2021-07-06 16:40 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28  9:52 [PATCH v4 0/3] scsi/dm: dm_blk_ioctl(): implement failover for SG_IO on dm-multipath mwilck
2021-06-28  9:52 ` [dm-devel] " mwilck
2021-06-28  9:52 ` [PATCH v4 1/3] scsi: scsi_ioctl: export __scsi_result_to_blk_status() mwilck
2021-06-28  9:52   ` [dm-devel] " mwilck
2021-06-28  9:53   ` Christoph Hellwig
2021-06-28  9:53     ` [dm-devel] " Christoph Hellwig
2021-06-28 14:57     ` Martin Wilck
2021-06-28 14:57       ` [dm-devel] " Martin Wilck
2021-06-29 12:59       ` Christoph Hellwig
2021-06-29 12:59         ` [dm-devel] " Christoph Hellwig
2021-06-29 19:23         ` Martin Wilck
2021-06-29 19:23           ` [dm-devel] " Martin Wilck
2021-06-29 21:23           ` Keith Busch
2021-06-29 21:23             ` [dm-devel] " Keith Busch
2021-06-30  8:12             ` Martin Wilck
2021-06-30  8:12               ` [dm-devel] " Martin Wilck
2021-06-30 16:01               ` Mike Snitzer
2021-06-30 16:01                 ` [dm-devel] " Mike Snitzer
2021-06-30 16:54                 ` Martin Wilck
2021-06-30 16:54                   ` [dm-devel] " Martin Wilck
2021-06-30 22:08                   ` Bart Van Assche
2021-06-30 22:08                     ` [dm-devel] " Bart Van Assche
2021-07-01  6:19                     ` Christoph Hellwig
2021-07-01  6:19                       ` [dm-devel] " Christoph Hellwig
2021-07-06 16:40                       ` Paolo Bonzini
2021-07-06 16:40                         ` [dm-devel] " Paolo Bonzini
2021-06-28  9:52 ` [PATCH v4 2/3] scsi: scsi_ioctl: add sg_io_to_blk_status() mwilck
2021-06-28  9:52   ` [dm-devel] " mwilck
2021-06-28 14:39   ` kernel test robot
2021-06-28 14:39     ` kernel test robot
2021-06-28 14:39     ` [dm-devel] " kernel test robot
2021-06-28  9:52 ` [PATCH v4 3/3] dm mpath: add CONFIG_DM_MULTIPATH_SG_IO - failover for SG_IO mwilck
2021-06-28  9:52   ` [dm-devel] " mwilck
2021-06-28 16:06 [PATCH v4 2/3] scsi: scsi_ioctl: add sg_io_to_blk_status() kernel test robot
2021-06-29  7:00 ` [kbuild] " Dan Carpenter
2021-06-29  7:00 ` [dm-devel] " Dan Carpenter
2021-06-29  7:00 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.