Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fff648da authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "Here's the second round of block updates for this merge window.

  It's a mix of fixes for changes that went in previously in this round,
  and fixes in general.  This pull request contains:

   - Fixes for loop from Christoph

   - A bdi vs gendisk lifetime fix from Dan, worth two cookies.

   - A blk-mq timeout fix, when on frozen queues.  From Gabriel.

   - Writeback fix from Jan, ensuring that __writeback_single_inode()
     does the right thing.

   - Fix for bio->bi_rw usage in f2fs from me.

   - Error path deadlock fix in blk-mq sysfs registration from me.

   - Floppy O_ACCMODE fix from Jiri.

   - Fix to the new bio op methods from Mike.

     One more followup will be coming here, ensuring that we don't
     propagate the block types outside of block.  That, and a rename of
     bio->bi_rw is coming right after -rc1 is cut.

   - Various little fixes"

* 'for-linus' of git://git.kernel.dk/linux-block:
  mm/block: convert rw_page users to bio op use
  loop: make do_req_filebacked more robust
  loop: don't try to use AIO for discards
  blk-mq: fix deadlock in blk_mq_register_disk() error path
  Include: blkdev: Removed duplicate 'struct request;' declaration.
  Fixup direct bi_rw modifiers
  block: fix bdi vs gendisk lifetime mismatch
  blk-mq: Allow timeouts to run while queue is freezing
  nbd: fix race in ioctl
  block: fix use-after-free in seq file
  f2fs: drop bio->bi_rw manual assignment
  block: add missing group association in bio-cloning functions
  blkcg: kill unused field nr_undestroyed_grps
  writeback: Write dirty times for WB_SYNC_ALL writeback
  floppy: fix open(O_ACCMODE) for ioctl-only open
parents 62e6e9ba abf54548
Loading
Loading
Loading
Loading
+15 −0
Original line number Original line Diff line number Diff line
@@ -583,6 +583,8 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src)
	bio->bi_rw = bio_src->bi_rw;
	bio->bi_rw = bio_src->bi_rw;
	bio->bi_iter = bio_src->bi_iter;
	bio->bi_iter = bio_src->bi_iter;
	bio->bi_io_vec = bio_src->bi_io_vec;
	bio->bi_io_vec = bio_src->bi_io_vec;

	bio_clone_blkcg_association(bio, bio_src);
}
}
EXPORT_SYMBOL(__bio_clone_fast);
EXPORT_SYMBOL(__bio_clone_fast);


@@ -687,6 +689,8 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask,
		}
		}
	}
	}


	bio_clone_blkcg_association(bio, bio_src);

	return bio;
	return bio;
}
}
EXPORT_SYMBOL(bio_clone_bioset);
EXPORT_SYMBOL(bio_clone_bioset);
@@ -2004,6 +2008,17 @@ void bio_disassociate_task(struct bio *bio)
	}
	}
}
}


/**
 * bio_clone_blkcg_association - clone blkcg association from src to dst bio
 * @dst: destination bio
 * @src: source bio
 */
void bio_clone_blkcg_association(struct bio *dst, struct bio *src)
{
	if (src->bi_css)
		WARN_ON(bio_associate_blkcg(dst, src->bi_css));
}

#endif /* CONFIG_BLK_CGROUP */
#endif /* CONFIG_BLK_CGROUP */


static void __init biovec_init_slabs(void)
static void __init biovec_init_slabs(void)
+8 −4
Original line number Original line Diff line number Diff line
@@ -380,15 +380,13 @@ static int blk_mq_register_hctx(struct blk_mq_hw_ctx *hctx)
	return ret;
	return ret;
}
}


void blk_mq_unregister_disk(struct gendisk *disk)
static void __blk_mq_unregister_disk(struct gendisk *disk)
{
{
	struct request_queue *q = disk->queue;
	struct request_queue *q = disk->queue;
	struct blk_mq_hw_ctx *hctx;
	struct blk_mq_hw_ctx *hctx;
	struct blk_mq_ctx *ctx;
	struct blk_mq_ctx *ctx;
	int i, j;
	int i, j;


	blk_mq_disable_hotplug();

	queue_for_each_hw_ctx(q, hctx, i) {
	queue_for_each_hw_ctx(q, hctx, i) {
		blk_mq_unregister_hctx(hctx);
		blk_mq_unregister_hctx(hctx);


@@ -405,6 +403,12 @@ void blk_mq_unregister_disk(struct gendisk *disk)
	kobject_put(&disk_to_dev(disk)->kobj);
	kobject_put(&disk_to_dev(disk)->kobj);


	q->mq_sysfs_init_done = false;
	q->mq_sysfs_init_done = false;
}

void blk_mq_unregister_disk(struct gendisk *disk)
{
	blk_mq_disable_hotplug();
	__blk_mq_unregister_disk(disk);
	blk_mq_enable_hotplug();
	blk_mq_enable_hotplug();
}
}


@@ -450,7 +454,7 @@ int blk_mq_register_disk(struct gendisk *disk)
	}
	}


	if (ret)
	if (ret)
		blk_mq_unregister_disk(disk);
		__blk_mq_unregister_disk(disk);
	else
	else
		q->mq_sysfs_init_done = true;
		q->mq_sysfs_init_done = true;
out:
out:
+14 −1
Original line number Original line Diff line number Diff line
@@ -672,7 +672,20 @@ static void blk_mq_timeout_work(struct work_struct *work)
	};
	};
	int i;
	int i;


	if (blk_queue_enter(q, true))
	/* A deadlock might occur if a request is stuck requiring a
	 * timeout at the same time a queue freeze is waiting
	 * completion, since the timeout code would not be able to
	 * acquire the queue reference here.
	 *
	 * That's why we don't use blk_queue_enter here; instead, we use
	 * percpu_ref_tryget directly, because we need to be able to
	 * obtain a reference even in the short window between the queue
	 * starting to freeze, by dropping the first reference in
	 * blk_mq_freeze_queue_start, and the moment the last request is
	 * consumed, marked by the instant q_usage_counter reaches
	 * zero.
	 */
	if (!percpu_ref_tryget(&q->q_usage_counter))
		return;
		return;


	blk_mq_queue_tag_busy_iter(q, blk_mq_check_expired, &data);
	blk_mq_queue_tag_busy_iter(q, blk_mq_check_expired, &data);
+0 −5
Original line number Original line Diff line number Diff line
@@ -145,11 +145,6 @@ struct throtl_data
	/* Total Number of queued bios on READ and WRITE lists */
	/* Total Number of queued bios on READ and WRITE lists */
	unsigned int nr_queued[2];
	unsigned int nr_queued[2];


	/*
	 * number of total undestroyed groups
	 */
	unsigned int nr_undestroyed_grps;

	/* Work for dispatching throttled bios */
	/* Work for dispatching throttled bios */
	struct work_struct dispatch_work;
	struct work_struct dispatch_work;
};
};
+2 −1
Original line number Original line Diff line number Diff line
@@ -614,7 +614,7 @@ void device_add_disk(struct device *parent, struct gendisk *disk)


	/* Register BDI before referencing it from bdev */
	/* Register BDI before referencing it from bdev */
	bdi = &disk->queue->backing_dev_info;
	bdi = &disk->queue->backing_dev_info;
	bdi_register_dev(bdi, disk_devt(disk));
	bdi_register_owner(bdi, disk_to_dev(disk));


	blk_register_region(disk_devt(disk), disk->minors, NULL,
	blk_register_region(disk_devt(disk), disk->minors, NULL,
			    exact_match, exact_lock, disk);
			    exact_match, exact_lock, disk);
@@ -856,6 +856,7 @@ static void disk_seqf_stop(struct seq_file *seqf, void *v)
	if (iter) {
	if (iter) {
		class_dev_iter_exit(iter);
		class_dev_iter_exit(iter);
		kfree(iter);
		kfree(iter);
		seqf->private = NULL;
	}
	}
}
}


Loading