summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-10 20:26:55 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-10 20:26:55 +0400
commitdd76a786af1f09e9122e150d30156e094e2a94b4 (patch)
tree97ff3d0d45d8df3294d3ec913eec728eb1c2ab57 /fs
parente7990d45bb88c2f0565b5ee4c32eefe81653faff (diff)
parent360f92c2443073143467a0088daffec96a17910b (diff)
downloadlinux-dd76a786af1f09e9122e150d30156e094e2a94b4.tar.xz
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.c22
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)
*/
int bio_integrity_enabled(struct bio *bio)
{
+ if (!bio_is_rw(bio))
+ return 0;
+
/* Already protected? */
if (bio_integrity(bio))
return 0;
@@ -309,10 +312,9 @@ static int bio_integrity_generate_verify(struct bio *bio, int operate)
{
struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev);
struct blk_integrity_exchg bix;
- struct bio_vec bv;
- struct bvec_iter iter;
+ struct bio_vec *bv;
sector_t sector;
- unsigned int sectors, ret = 0;
+ unsigned int sectors, ret = 0, i;
void *prot_buf = bio->bi_integrity->bip_buf;
if (operate)
@@ -323,16 +325,16 @@ static int bio_integrity_generate_verify(struct bio *bio, int operate)
bix.disk_name = bio->bi_bdev->bd_disk->disk_name;
bix.sector_size = bi->sector_size;
- bio_for_each_segment(bv, bio, iter) {
- void *kaddr = kmap_atomic(bv.bv_page);
- bix.data_buf = kaddr + bv.bv_offset;
- bix.data_size = bv.bv_len;
+ bio_for_each_segment_all(bv, bio, i) {
+ void *kaddr = kmap_atomic(bv->bv_page);
+ bix.data_buf = kaddr + bv->bv_offset;
+ bix.data_size = bv->bv_len;
bix.prot_buf = prot_buf;
bix.sector = sector;
- if (operate) {
+ if (operate)
bi->generate_fn(&bix);
- } else {
+ else {
ret = bi->verify_fn(&bix);
if (ret) {
kunmap_atomic(kaddr);
@@ -340,7 +342,7 @@ static int bio_integrity_generate_verify(struct bio *bio, int operate)
}
}
- sectors = bv.bv_len / bi->sector_size;
+ sectors = bv->bv_len / bi->sector_size;
sector += sectors;
prot_buf += sectors * bi->tuple_size;