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
此提交包含在:
@@ -825,6 +825,20 @@ int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev)
|
||||
}
|
||||
EXPORT_SYMBOL(bdi_register_dev);
|
||||
|
||||
int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = bdi_register(bdi, NULL, "%u:%u", MAJOR(owner->devt),
|
||||
MINOR(owner->devt));
|
||||
if (rc)
|
||||
return rc;
|
||||
bdi->owner = owner;
|
||||
get_device(owner);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(bdi_register_owner);
|
||||
|
||||
/*
|
||||
* Remove bdi from bdi_list, and ensure that it is no longer visible
|
||||
*/
|
||||
@@ -849,6 +863,11 @@ void bdi_unregister(struct backing_dev_info *bdi)
|
||||
device_unregister(bdi->dev);
|
||||
bdi->dev = NULL;
|
||||
}
|
||||
|
||||
if (bdi->owner) {
|
||||
put_device(bdi->owner);
|
||||
bdi->owner = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void bdi_exit(struct backing_dev_info *bdi)
|
||||
|
@@ -887,9 +887,9 @@ EXPORT_SYMBOL(end_page_writeback);
|
||||
* After completing I/O on a page, call this routine to update the page
|
||||
* flags appropriately
|
||||
*/
|
||||
void page_endio(struct page *page, int rw, int err)
|
||||
void page_endio(struct page *page, int op, int err)
|
||||
{
|
||||
if (rw == READ) {
|
||||
if (!op_is_write(op)) {
|
||||
if (!err) {
|
||||
SetPageUptodate(page);
|
||||
} else {
|
||||
@@ -897,7 +897,7 @@ void page_endio(struct page *page, int rw, int err)
|
||||
SetPageError(page);
|
||||
}
|
||||
unlock_page(page);
|
||||
} else { /* rw == WRITE */
|
||||
} else {
|
||||
if (err) {
|
||||
SetPageError(page);
|
||||
if (page->mapping)
|
||||
|
新增問題並參考
封鎖使用者