diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-10 12:26:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-10 12:26:55 -0400 |
commit | dd76a786af1f09e9122e150d30156e094e2a94b4 (patch) | |
tree | 97ff3d0d45d8df3294d3ec913eec728eb1c2ab57 /fs | |
parent | e7990d45bb88c2f0565b5ee4c32eefe81653faff (diff) | |
parent | 360f92c2443073143467a0088daffec96a17910b (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block layer fixes from Jens Axboe:
"A small collection of fixes that should go in before -rc1. The pull
request contains:
- A two patch fix for a regression with block enabled tagging caused
by a commit in the initial pull request. One patch is from Martin
and ensures that SCSI doesn't truncate 64-bit block flags, the
other one is from me and prevents us from double using struct
request queuelist for both completion and busy tags. This caused
anything from a boot crash for some, to crashes under load.
- A blk-mq fix for a potential soft stall when hot unplugging CPUs
with busy IO.
- percpu_counter fix is listed in here, that caused a suspend issue
with virtio-blk due to percpu counters having an inconsistent state
during CPU removal. Andrew sent this in separately a few days ago,
but it's here. JFYI.
- A few fixes for block integrity from Martin.
- A ratelimit fix for loop from Mike Galbraith, to avoid spewing too
much in error cases"
* 'for-linus' of git://git.kernel.dk/linux-block:
block: fix regression with block enabled tagging
scsi: Make sure cmd_flags are 64-bit
block: Ensure we only enable integrity metadata for reads and writes
block: Fix integrity verification
block: Fix for_each_bvec()
drivers/block/loop.c: ratelimit error messages
blk-mq: fix potential stall during CPU unplug with IO pending
percpu_counter: fix bad counter state during suspend
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bio-integrity.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c index 29696b78d1f4..1c2ce0c87711 100644 --- a/fs/bio-integrity.c +++ b/fs/bio-integrity.c | |||
@@ -182,6 +182,9 @@ static int bdev_integrity_enabled(struct block_device *bdev, int rw) | |||
182 | */ | 182 | */ |
183 | int bio_integrity_enabled(struct bio *bio) | 183 | int bio_integrity_enabled(struct bio *bio) |
184 | { | 184 | { |
185 | if (!bio_is_rw(bio)) | ||
186 | return 0; | ||
187 | |||
185 | /* Already protected? */ | 188 | /* Already protected? */ |
186 | if (bio_integrity(bio)) | 189 | if (bio_integrity(bio)) |
187 | return 0; | 190 | return 0; |
@@ -309,10 +312,9 @@ static int bio_integrity_generate_verify(struct bio *bio, int operate) | |||
309 | { | 312 | { |
310 | struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev); | 313 | struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev); |
311 | struct blk_integrity_exchg bix; | 314 | struct blk_integrity_exchg bix; |
312 | struct bio_vec bv; | 315 | struct bio_vec *bv; |
313 | struct bvec_iter iter; | ||
314 | sector_t sector; | 316 | sector_t sector; |
315 | unsigned int sectors, ret = 0; | 317 | unsigned int sectors, ret = 0, i; |
316 | void *prot_buf = bio->bi_integrity->bip_buf; | 318 | void *prot_buf = bio->bi_integrity->bip_buf; |
317 | 319 | ||
318 | if (operate) | 320 | if (operate) |
@@ -323,16 +325,16 @@ static int bio_integrity_generate_verify(struct bio *bio, int operate) | |||
323 | bix.disk_name = bio->bi_bdev->bd_disk->disk_name; | 325 | bix.disk_name = bio->bi_bdev->bd_disk->disk_name; |
324 | bix.sector_size = bi->sector_size; | 326 | bix.sector_size = bi->sector_size; |
325 | 327 | ||
326 | bio_for_each_segment(bv, bio, iter) { | 328 | bio_for_each_segment_all(bv, bio, i) { |
327 | void *kaddr = kmap_atomic(bv.bv_page); | 329 | void *kaddr = kmap_atomic(bv->bv_page); |
328 | bix.data_buf = kaddr + bv.bv_offset; | 330 | bix.data_buf = kaddr + bv->bv_offset; |
329 | bix.data_size = bv.bv_len; | 331 | bix.data_size = bv->bv_len; |
330 | bix.prot_buf = prot_buf; | 332 | bix.prot_buf = prot_buf; |
331 | bix.sector = sector; | 333 | bix.sector = sector; |
332 | 334 | ||
333 | if (operate) { | 335 | if (operate) |
334 | bi->generate_fn(&bix); | 336 | bi->generate_fn(&bix); |
335 | } else { | 337 | else { |
336 | ret = bi->verify_fn(&bix); | 338 | ret = bi->verify_fn(&bix); |
337 | if (ret) { | 339 | if (ret) { |
338 | kunmap_atomic(kaddr); | 340 | kunmap_atomic(kaddr); |
@@ -340,7 +342,7 @@ static int bio_integrity_generate_verify(struct bio *bio, int operate) | |||
340 | } | 342 | } |
341 | } | 343 | } |
342 | 344 | ||
343 | sectors = bv.bv_len / bi->sector_size; | 345 | sectors = bv->bv_len / bi->sector_size; |
344 | sector += sectors; | 346 | sector += sectors; |
345 | prot_buf += sectors * bi->tuple_size; | 347 | prot_buf += sectors * bi->tuple_size; |
346 | 348 | ||