Re: BUG: hot removal during writes on ext4 formatted nvme device

2017-05-18 Thread Dmitry Monakhov
Jon Derrick writes: > Hello, > > I've encountered a BUG that I've experienced during hot removal on an > ext4-formatted nvme device undergoing writes. I have been able to verify > that 4.5, 4.6, 4.10.12, 4.11, and 4.12-rc1 show similar issues (the v4.6 > trace below

Re: Announcing blktests

2017-05-15 Thread Dmitry Monakhov
Omar Sandoval writes: > Hi, everyone, > > At LSF/MM, we talked about the need for somewhere to dump tests for the > block layer/storage stack. I've put together a test suite inspired by > xfstests here: https://github.com/osandov/blktests. > > I started out with the opinion

Re: [PATCH 0/9] block: T10/DIF Fixes and cleanups v3

2017-05-10 Thread Dmitry Monakhov
Christoph Hellwig writes: > Hi Dmitry, > > can you resend this series? Sorry for a very long delay, I'm in the middle of honeymoon and this is not a good time for a work :) > I really think we should get this into 4.12 at least. Please see updated version in the LKML list.

[PATCH 4/9] bio-integrity: fix interface for bio_integrity_trim

2017-05-10 Thread Dmitry Monakhov
== bio_sectors(bio) Let's just remove them completely. Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- bl

[PATCH 1/9] bio-integrity: Do not allocate integrity context for bio w/o data

2017-05-10 Thread Dmitry Monakhov
K. Petersen <martin.peter...@oracle.com> Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio-integrity.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 5384713..b5009a8 100644 --- a/block/bio-integrity.c +++

[PATCH 7/9] Guard bvec iteration logic

2017-05-10 Thread Dmitry Monakhov
. This patch does: - Return error back to caller with hope that it will react on this - Truncate iterator size Code was added long time ago here 4550dd6c, luckily no one hit it in real life :) changes since V1: - Replace BUG_ON with error logic. Signed-off-by: Dmitry Monakhov <dmo

[PATCH 2/9] bio-integrity: bio_trim should truncate integrity vector accordingly

2017-05-10 Thread Dmitry Monakhov
Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio.c | 4 1 file changed, 4 insertions(+) diff --g

[PATCH 3/9] bio-integrity: bio_integrity_advance must update integrity seed

2017-05-10 Thread Dmitry Monakhov
SCSI drivers do care about bip_seed so we must update it accordingly. Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio-integrity.c | 1 + 1 file changed, 1 insert

[PATCH 6/9] T10: Move opencoded contants to common header

2017-05-10 Thread Dmitry Monakhov
Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/t10-pi.c | 9 +++-- drivers/scsi/lpfc/lpfc_scsi.c| 5 +++-- drivers/scsi/qla2xxx/qla_isr.c | 8 drivers/target/target_core_sbc.c | 2 +- include/linux/t10-pi.h | 2 ++ 5 files c

[PATCH 8/9] bio: add bvec_iter rewind API

2017-05-10 Thread Dmitry Monakhov
@lst.de> Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- include/linux/bio.h | 21 +++-- include/linux/bvec.h | 27 +++ 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index

[PATCH 9/9] bio-integrity: Restore original iterator on verify stage

2017-05-10 Thread Dmitry Monakhov
ub.com/dmonakhov/xfstests/commit/3c6509eaa83b9c17cd0bc95d73fcdd76e1c54a85 Reviewed-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio-integrity.c | 22 +++--- 1 file chan

[PATCH 0/9] block: T10/DIF Fixes and cleanups v4

2017-05-10 Thread Dmitry Monakhov
TOC: 1-bio-integrity-Do-not-allocate-integrity-context-for-fsync 2-bio-integrity-bio_trim-should-truncate-integrity-vector 3-bio-integrity-bio_integrity_advance-must-update-interator 4-bio-integrity-fix-interface-for-bio_integrity_trim 5-bio-integrity-fold-bio_integrity_enabled-to-bio_interator

Re: [PATCH 3/9] bio-integrity: bio_integrity_advance must update integrity seed

2017-05-03 Thread Dmitry Monakhov
"Martin K. Petersen" <martin.peter...@oracle.com> writes: > Dmitry Monakhov <dmonak...@openvz.org> writes: > >> SCSI drivers do care about bip_seed so we must update it accordingly. > >> +bip->bip_iter.bi_sector += bytes_done >> 9; >

[PATCH 6/6] new: blockdev/005 Check that busy fs survives blkdev page truncation

2017-04-06 Thread Dmitry Monakhov
same as blockdev/004 but with add more stress on corrupted fs. Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- tests/blockdev/005 | 92 ++ tests/blockdev/005.out | 2 ++ tests/blockdev/group | 1 + tests/generic/390 |

[PATCH 5/6] new: blockdev/004 Check that live fs survives blkdev page truncation

2017-04-06 Thread Dmitry Monakhov
Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- tests/blockdev/004 | 81 ++ tests/blockdev/004.out | 2 ++ tests/blockdev/group | 1 + 3 files changed, 84 insertions(+) create mode 100755 tests/blockdev/004 create mode

[PATCH 2/6] add: blockdev/001 check page-cache coherency after BLKDISCARD

2017-04-06 Thread Dmitry Monakhov
Regression test for fix https://lkml.org/lkml/2017/3/22/789 Page cache should be dropped after successful discard Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- common/config | 1 + tests/blockdev/001 | 74 ++

[PATCH 0/6] RFC add blkdev tests v2

2017-04-06 Thread Dmitry Monakhov
During LSFMM we have discussed how to test lower-backend of linux IO-stack. Main idea was that xfstests is the most obvious solution which cover most use-cases filesystem do care about. There were reasonable objections that xfstests is not ideal place for that, especially when they mixed with pure

[PATCH 4/6] new: blockdev/003 basic blockdev T10-DIF-TYPE1 integrity checks

2017-04-06 Thread Dmitry Monakhov
because even if pread failed, xfs_io still exit with success, BUG? Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- tests/blockdev/003 | 164 + tests/blockdev/003.out | 39 tests/blockdev/group | 1 + 3 files change

[PATCH 1/6] add lio-target helpers

2017-04-06 Thread Dmitry Monakhov
Linux-IO Target is very good framework for testing block backend. It is more flexible than scsi_debug. http://linux-iscsi.org/wiki/LIO Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- common/config| 2 + common/liotarget

[PATCH 1/9] bio-integrity: Do not allocate integrity context for bio w/o data

2017-04-04 Thread Dmitry Monakhov
blkdev_issue_flush+0x7a/0x85 blkdev_fsync+0x35/0x42 vfs_fsync_range+0x8e/0x9f vfs_fsync+0x1c/0x1e do_fsync+0x31/0x4a SyS_fsync+0x10/0x14 entry_SYSCALL_64_fastpath+0x1f/0xc2 Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --

[PATCH 3/9] bio-integrity: bio_integrity_advance must update integrity seed

2017-04-04 Thread Dmitry Monakhov
SCSI drivers do care about bip_seed so we must update it accordingly. Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio-integrity.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index b5009a8..82a6ffb 100644 --- a/blo

[PATCH 2/9] bio-integrity: bio_trim should truncate integrity vector accordingly

2017-04-04 Thread Dmitry Monakhov
Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio.c | 4 1 file changed, 4 insertions(+) diff --git a/block/bio.c b/block/bio.c index e75878f..fa84323 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1907,6 +190

[PATCH 7/9] Guard bvec iteration logic v3

2017-04-04 Thread Dmitry Monakhov
. This patch does: - Return error back to caller with hope that it will react on this - Truncate iterator size Code was added long time ago here 4550dd6c, luckily no one hit it in real life :) changes since V1: - Replace BUG_ON with error logic. Signed-off-by: Dmitry Monakhov <dmo

[PATCH 8/9] bio: add bvec_iter rewind API

2017-04-04 Thread Dmitry Monakhov
tes iterator was advanced during it's evolution. Later end_io handler may easily restore original iterator by rewinding iterator to iter->bi_done. Note: this change makes sizeof (struct bvec_iter) multiple to 8 Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- include/linux

[PATCH 5/9] bio-integrity: fold bio_integrity_enabled to bio_integrity_prep

2017-04-04 Thread Dmitry Monakhov
it in to one function. Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- Documentation/block/data-integrity.txt | 3 -- block/bio-integrity.c | 88 ++ block/blk-core.c | 5 +- block/bl

[PATCH 6/9] T10: Move opencoded contants to common header

2017-04-04 Thread Dmitry Monakhov
Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/t10-pi.c | 9 +++-- drivers/scsi/lpfc/lpfc_scsi.c| 5 +++-- drivers/scsi/qla2xxx/qla_isr.c | 8 drivers/target/target_core_sbc.c | 2 +- include/linux/t10-pi.h | 2 ++ 5 files c

[PATCH 9/9] bio-integrity: Restore original iterator on verify stage

2017-04-04 Thread Dmitry Monakhov
ub.com/dmonakhov/xfstests/commit/3c6509eaa83b9c17cd0bc95d73fcdd76e1c54a85 Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio-integrity.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index f2b9

[PATCH 0/9] block: T10/DIF Fixes and cleanups v3

2017-04-04 Thread Dmitry Monakhov
This patch set fix various problems spotted during T10/DIF integrity machinery testing. TOC: ## Fix various bugs in T10/DIF/DIX infrastructure 0001-bio-integrity-Do-not-allocate-integrity-context-for 0002-bio-integrity-bio_trim-should-truncate-integrity-vec

Re: [PATCH 7/7] Guard bvec iteration logic v2

2017-04-04 Thread Dmitry Monakhov
Ming Lei <tom.leim...@gmail.com> writes: > On Mon, Apr 3, 2017 at 3:23 PM, Dmitry Monakhov <dmonak...@openvz.org> wrote: >> Currently if some one try to advance bvec beyond it's size we simply >> dump WARN_ONCE and continue to iterate beyond bvec array boundaries. &

Re: [PATCH 2/7] bio-integrity: save original iterator for verify stage

2017-04-04 Thread Dmitry Monakhov
Christoph Hellwig writes: > This is a pretty big increase in the bio_integrity_payload size, > but I guess we can't get around it.. Yes, everybody hate this solution, me too, but I've stated with other approach and it is appeaded to be very ugly. My idea was that we have

[PATCH 1/2] scsi: convert unrecovered read error to -EILSEQ

2017-04-03 Thread Dmitry Monakhov
--direct=1 --group_reporting --rw=read --bs=1M \ --iodepth=16 --size=1G --filesize=1G --name=/dev/sdb --name /dev/sdc More info about URE probability here: https://plus.google.com/101761226576930717211/posts/Pctq7kk1dLL Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- drivers/scsi

[PATCH 2/2] block: Improve error handling verbosity

2017-04-03 Thread Dmitry Monakhov
EILSEQ is returned due to internal csum error on disk/fabric, let's add special message to distinguish it from others. Also dump original numerical error code. Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/blk-core.c | 7 +-- 1 file changed, 5 insertions(+), 2 del

[PATCH 4/7] bio-integrity: fix interface for bio_integrity_trim

2017-04-03 Thread Dmitry Monakhov
it completely. TODO: add xfstests testcase here Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio-integrity.c | 8 +--- block/bio.c | 4 ++-- drivers/md/dm.c | 2 +- include/linux/bio.h | 5 ++--- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a

[PATCH 3/7] bio-integrity: bio_trim should truncate integrity vector accordingly

2017-04-03 Thread Dmitry Monakhov
Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio.c | 4 1 file changed, 4 insertions(+) diff --git a/block/bio.c b/block/bio.c index e75878f..fa84323 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1907,6 +1907,10 @@ void bio_trim(struct bio *bio, int offset, in

[PATCH 1/7] bio-integrity: Do not allocate integrity context for bio w/o data

2017-04-03 Thread Dmitry Monakhov
blkdev_issue_flush+0x7a/0x85 blkdev_fsync+0x35/0x42 vfs_fsync_range+0x8e/0x9f vfs_fsync+0x1c/0x1e do_fsync+0x31/0x4a SyS_fsync+0x10/0x14 entry_SYSCALL_64_fastpath+0x1f/0xc2 Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio-integrity.c | 3 +++ 1 file changed, 3 inse

[PATCH 2/7] bio-integrity: save original iterator for verify stage

2017-04-03 Thread Dmitry Monakhov
bio->bi_iter.bi_size == 0 The simplest way to fix that is to save original data vector and treat is as immutable. Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio-integrity.c | 6 -- include/linux/bio.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git

[PATCH 0/7] block: T10/DIF Fixes and cleanups v2

2017-04-03 Thread Dmitry Monakhov
This patch set fix various problems spotted during T10/DIF integrity machinery testing. TOC: ## Fix various bugs in T10/DIF/DIX infrastructure 0001-bio-integrity-Do-not-allocate-integrity-context-for-fsync 0002-bio-integrity-save-original-iterator-for-verify-stage

[PATCH 3/8] bio-integrity: save original iterator for verify stage

2017-03-30 Thread Dmitry Monakhov
bio->bi_iter.bi_size == 0 The simplest way to fix that is to save original data vector and treat is as immutable. Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio-integrity.c | 6 -- include/linux/bio.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git

[PATCH 4/8] bio-integrity: bio_trim should truncate integrity vector accordingly

2017-03-30 Thread Dmitry Monakhov
Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio.c | 4 1 file changed, 4 insertions(+) diff --git a/block/bio.c b/block/bio.c index e75878f..fa84323 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1907,6 +1907,10 @@ void bio_trim(struct bio *bio, int offset, in

[PATCH 7/8] T10: Move opencoded contants to common header

2017-03-30 Thread Dmitry Monakhov
Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/t10-pi.c | 9 +++-- drivers/scsi/lpfc/lpfc_scsi.c| 4 ++-- drivers/scsi/qla2xxx/qla_isr.c | 8 drivers/target/target_core_sbc.c | 2 +- include/linux/t10-pi.h | 3 +++ 5 files c

[PATCH 8/8] tcm_fileio: Prevent information leak for short reads

2017-03-30 Thread Dmitry Monakhov
/?l=linux-scsi=149087996913448=2 Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- drivers/target/target_core_file.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 8

[PATCH 5/8] bio-integrity: fix interface for bio_integrity_trim

2017-03-30 Thread Dmitry Monakhov
it completely. Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio-integrity.c | 8 +--- block/bio.c | 4 ++-- drivers/md/dm.c | 2 +- include/linux/bio.h | 5 ++--- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/block/bio-integrity.c b/blo

[PATCH 1/8] Guard bvec iteration logic

2017-03-30 Thread Dmitry Monakhov
:) Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- include/linux/bvec.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index 89b65b8..86b914f 100644 --- a/include/linux/bvec.h +++ b/include/linux/bvec.h @@ -70,8

[PATCH 2/8] bio-integrity: Do not allocate integrity context for bio w/o data

2017-03-30 Thread Dmitry Monakhov
blkdev_issue_flush+0x7a/0x85 blkdev_fsync+0x35/0x42 vfs_fsync_range+0x8e/0x9f vfs_fsync+0x1c/0x1e do_fsync+0x31/0x4a SyS_fsync+0x10/0x14 entry_SYSCALL_64_fastpath+0x1f/0xc2 Signed-off-by: Dmitry Monakhov <dmonak...@openvz.org> --- block/bio-integrity.c | 3 +++ 1 file changed, 3 inse