diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-05 23:31:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-05 23:31:51 -0400 |
commit | fff648da962992eeef607100e1df070de0173692 (patch) | |
tree | 300ed947c82f5934f31d322460d26d796fac7c1a /mm | |
parent | 62e6e9bab3014e3931ffbc82de7a9d2fd94cb8cd (diff) | |
parent | abf545484d31b68777a85c5c8f5b4bcde08283eb (diff) |
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
Diffstat (limited to 'mm')
-rw-r--r-- | mm/backing-dev.c | 19 | ||||
-rw-r--r-- | mm/filemap.c | 6 |
2 files changed, 22 insertions, 3 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index efe237742074..8fde443f36d7 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -825,6 +825,20 @@ int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev) | |||
825 | } | 825 | } |
826 | EXPORT_SYMBOL(bdi_register_dev); | 826 | EXPORT_SYMBOL(bdi_register_dev); |
827 | 827 | ||
828 | int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner) | ||
829 | { | ||
830 | int rc; | ||
831 | |||
832 | rc = bdi_register(bdi, NULL, "%u:%u", MAJOR(owner->devt), | ||
833 | MINOR(owner->devt)); | ||
834 | if (rc) | ||
835 | return rc; | ||
836 | bdi->owner = owner; | ||
837 | get_device(owner); | ||
838 | return 0; | ||
839 | } | ||
840 | EXPORT_SYMBOL(bdi_register_owner); | ||
841 | |||
828 | /* | 842 | /* |
829 | * Remove bdi from bdi_list, and ensure that it is no longer visible | 843 | * Remove bdi from bdi_list, and ensure that it is no longer visible |
830 | */ | 844 | */ |
@@ -849,6 +863,11 @@ void bdi_unregister(struct backing_dev_info *bdi) | |||
849 | device_unregister(bdi->dev); | 863 | device_unregister(bdi->dev); |
850 | bdi->dev = NULL; | 864 | bdi->dev = NULL; |
851 | } | 865 | } |
866 | |||
867 | if (bdi->owner) { | ||
868 | put_device(bdi->owner); | ||
869 | bdi->owner = NULL; | ||
870 | } | ||
852 | } | 871 | } |
853 | 872 | ||
854 | void bdi_exit(struct backing_dev_info *bdi) | 873 | void bdi_exit(struct backing_dev_info *bdi) |
diff --git a/mm/filemap.c b/mm/filemap.c index 3083ded98b15..daef091d4c50 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -887,9 +887,9 @@ EXPORT_SYMBOL(end_page_writeback); | |||
887 | * After completing I/O on a page, call this routine to update the page | 887 | * After completing I/O on a page, call this routine to update the page |
888 | * flags appropriately | 888 | * flags appropriately |
889 | */ | 889 | */ |
890 | void page_endio(struct page *page, int rw, int err) | 890 | void page_endio(struct page *page, int op, int err) |
891 | { | 891 | { |
892 | if (rw == READ) { | 892 | if (!op_is_write(op)) { |
893 | if (!err) { | 893 | if (!err) { |
894 | SetPageUptodate(page); | 894 | SetPageUptodate(page); |
895 | } else { | 895 | } else { |
@@ -897,7 +897,7 @@ void page_endio(struct page *page, int rw, int err) | |||
897 | SetPageError(page); | 897 | SetPageError(page); |
898 | } | 898 | } |
899 | unlock_page(page); | 899 | unlock_page(page); |
900 | } else { /* rw == WRITE */ | 900 | } else { |
901 | if (err) { | 901 | if (err) { |
902 | SetPageError(page); | 902 | SetPageError(page); |
903 | if (page->mapping) | 903 | if (page->mapping) |