Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1644334

[PATCH 4.10 30/93] block: fix blk_integrity_register to use templates interval_exp if not 0

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.10 30/93] block: fix blk_integrity_register to use templates interval_exp if not 0
Date 2017-05-18 13:50 +0200
Message-ID <tIs6m-1V1-37@gated-at.bofh.it> (permalink)
References <tIrjX-1e5-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mike Snitzer <snitzer@redhat.com>

commit 2859323e35ab5fc42f351fbda23ab544eaa85945 upstream.

When registering an integrity profile: if the template's interval_exp is
not 0 use it, otherwise use the ilog2() of logical block size of the
provided gendisk.

This fixes a long-standing DM linear target bug where it cannot pass
integrity data to the underlying device if its logical block size
conflicts with the underlying device's logical block size.

Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 block/blk-integrity.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/block/blk-integrity.c
+++ b/block/blk-integrity.c
@@ -412,7 +412,8 @@ void blk_integrity_register(struct gendi
 
 	bi->flags = BLK_INTEGRITY_VERIFY | BLK_INTEGRITY_GENERATE |
 		template->flags;
-	bi->interval_exp = ilog2(queue_logical_block_size(disk->queue));
+	bi->interval_exp = template->interval_exp ? :
+		ilog2(queue_logical_block_size(disk->queue));
 	bi->profile = template->profile ? template->profile : &nop_profile;
 	bi->tuple_size = template->tuple_size;
 	bi->tag_size = template->tag_size;

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.10 00/93] 4.10.17-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 22/93] x86/boot: Fix BSS corruption/overwrite bug in early x86 kernel startup Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 34/93] crypto: ccp - Disable interrupts early on unload Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 30/93] block: fix blk_integrity_register to use templates interval_exp if not 0 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 03/93] target/fileio: Fix zero-length READ and WRITE handling Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 54/93] orangefs: fix bounds check for listxattr Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 62/93] Fix match_prepath() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 21/93] usb: misc: legousbtower: Fix buffers on stack Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 56/93] orangefs: do not set getattr_time on orangefs_lookup Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 57/93] orangefs: do not check possibly stale size on truncate Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 02/93] target: Fix compare_and_write_callback handling for non GOOD status Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 07/93] USB: serial: ftdi_sio: add device ID for Microsemi/Arrow SF2PLUS Dev Kit Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 08/93] USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 59/93] ceph: fix memory leak in __ceph_setxattr() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 43/93] IB/core: Fix sysfs registration error flow Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 26/93] perf/x86: Fix Broadwell-EP DRAM RAPL events Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 44/93] IB/core: For multicast functions, verify that LIDs are multicast LIDs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 13:50 +0200
  [PATCH 4.10 11/93] staging: vt6656: use off stack for out buffer USB transfers. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 14:00 +0200
  [PATCH 4.10 18/93] usb: Make sure usb/phy/of gets built-in Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 14:00 +0200
  [PATCH 4.10 01/93] xen: adjust early dom0 p2m handling to xen hypervisor behavior Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 14:00 +0200
  [PATCH 4.10 12/93] staging: gdm724x: gdm_mux: fix use-after-free on module unload Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 14:00 +0200
  [PATCH 4.10 14/93] staging: comedi: jr3_pci: fix possible null pointer dereference Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-18 14:00 +0200
  Re: [PATCH 4.10 00/93] 4.10.17-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-05-18 19:40 +0200
  Re: [PATCH 4.10 00/93] 4.10.17-stable review Guenter Roeck <linux@roeck-us.net> - 2017-05-19 03:20 +0200

csiph-web