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
Showing the changes to include (7 of 26 files). Show all
Unified · Split
| @@ -163,6 +163,7 @@ struct backing_dev_info { · 162 unmodified lines | ||
| 163 | 163 | wait_queue_head_t wb_waitq; |
| 164 | 164 | |
| 165 | 165 | struct device *dev; |
| 166 | + struct device *owner; | |
| 166 | 167 | |
| 167 | 168 | struct timer_list laptop_mode_wb_timer; |
| 168 | 169 | |
| @@ -24,6 +24,7 @@ __printf(3, 4) · 23 unmodified lines | ||
| 24 | 24 | int bdi_register(struct backing_dev_info *bdi, struct device *parent, |
| 25 | 25 | const char *fmt, ...); |
| 26 | 26 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); |
| 27 | +int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner); | |
| 27 | 28 | void bdi_unregister(struct backing_dev_info *bdi); |
| 28 | 29 | |
| 29 | 30 | int __must_check bdi_setup_and_register(struct backing_dev_info *, char *); |
| @@ -470,11 +470,14 @@ extern unsigned int bvec_nr_vecs(unsigned short idx); · 469 unmodified lines | ||
| 470 | 470 | int bio_associate_blkcg(struct bio *bio, struct cgroup_subsys_state *blkcg_css); |
| 471 | 471 | int bio_associate_current(struct bio *bio); |
| 472 | 472 | void bio_disassociate_task(struct bio *bio); |
| 473 | +void bio_clone_blkcg_association(struct bio *dst, struct bio *src); | |
| 473 | 474 | #else /* CONFIG_BLK_CGROUP */ |
| 474 | 475 | static inline int bio_associate_blkcg(struct bio *bio, |
| 475 | 476 | struct cgroup_subsys_state *blkcg_css) { return 0; } |
| 476 | 477 | static inline int bio_associate_current(struct bio *bio) { return -ENOENT; } |
| 477 | 478 | static inline void bio_disassociate_task(struct bio *bio) { } |
| 479 | +static inline void bio_clone_blkcg_association(struct bio *dst, | |
| 480 | + struct bio *src) { } | |
| 478 | 481 | #endif /* CONFIG_BLK_CGROUP */ |
| 479 | 482 | |
| 480 | 483 | #ifdef CONFIG_HIGHMEM |
| @@ -18,6 +18,17 @@ struct cgroup_subsys_state; · 17 unmodified lines | ||
| 18 | 18 | typedef void (bio_end_io_t) (struct bio *); |
| 19 | 19 | typedef void (bio_destructor_t) (struct bio *); |
| 20 | 20 | |
| 21 | +enum req_op { | |
| 22 | + REQ_OP_READ, | |
| 23 | + REQ_OP_WRITE, | |
| 24 | + REQ_OP_DISCARD, /* request to discard sectors */ | |
| 25 | + REQ_OP_SECURE_ERASE, /* request to securely erase sectors */ | |
| 26 | + REQ_OP_WRITE_SAME, /* write same block many times */ | |
| 27 | + REQ_OP_FLUSH, /* request for cache flush */ | |
| 28 | +}; | |
| 29 | + | |
| 30 | +#define REQ_OP_BITS 3 | |
| 31 | + | |
| 21 | 32 | #ifdef CONFIG_BLOCK |
| 22 | 33 | /* |
| 23 | 34 | * main unit of I/O for the block layer and lower layers (ie drivers and |
| @@ -228,17 +239,6 @@ enum rq_flag_bits { · 204 unmodified lines | ||
| 228 | 239 | #define REQ_HASHED (1ULL << __REQ_HASHED) |
| 229 | 240 | #define REQ_MQ_INFLIGHT (1ULL << __REQ_MQ_INFLIGHT) |
| 230 | 241 | |
| 231 | −enum req_op { | |
| 232 | − REQ_OP_READ, | |
| 233 | − REQ_OP_WRITE, | |
| 234 | − REQ_OP_DISCARD, /* request to discard sectors */ | |
| 235 | − REQ_OP_SECURE_ERASE, /* request to securely erase sectors */ | |
| 236 | − REQ_OP_WRITE_SAME, /* write same block many times */ | |
| 237 | − REQ_OP_FLUSH, /* request for cache flush */ | |
| 238 | −}; | |
| 239 | − | |
| 240 | −#define REQ_OP_BITS 3 | |
| 241 | − | |
| 242 | 242 | typedef unsigned int blk_qc_t; |
| 243 | 243 | #define BLK_QC_T_NONE -1U |
| 244 | 244 | #define BLK_QC_T_SHIFT 16 |
| @@ -47,7 +47,6 @@ struct pr_ops; · 46 unmodified lines | ||
| 47 | 47 | */ |
| 48 | 48 | #define BLKCG_MAX_POLS 2 |
| 49 | 49 | |
| 50 | −struct request; | |
| 51 | 50 | typedef void (rq_end_io_fn)(struct request *, int); |
| 52 | 51 | |
| 53 | 52 | #define BLK_RL_SYNCFULL (1U << 0) |
| @@ -1673,7 +1672,7 @@ struct blk_dax_ctl { · 1619 unmodified lines | ||
| 1673 | 1672 | struct block_device_operations { |
| 1674 | 1673 | int (*open) (struct block_device *, fmode_t); |
| 1675 | 1674 | void (*release) (struct gendisk *, fmode_t); |
| 1676 | − int (*rw_page)(struct block_device *, sector_t, struct page *, int rw); | |
| 1675 | + int (*rw_page)(struct block_device *, sector_t, struct page *, int op); | |
| 1677 | 1676 | int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
| 1678 | 1677 | int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long); |
| 1679 | 1678 | long (*direct_access)(struct block_device *, sector_t, void **, pfn_t *, |
| @@ -2480,12 +2480,13 @@ extern void init_special_inode(struct inode *, umode_t, dev_t); · 2479 unmodified lines | ||
| 2480 | 2480 | extern void make_bad_inode(struct inode *); |
| 2481 | 2481 | extern bool is_bad_inode(struct inode *); |
| 2482 | 2482 | |
| 2483 | −#ifdef CONFIG_BLOCK | |
| 2484 | 2483 | static inline bool op_is_write(unsigned int op) |
| 2485 | 2484 | { |
| 2486 | 2485 | return op == REQ_OP_READ ? false : true; |
| 2487 | 2486 | } |
| 2488 | 2487 | |
| 2488 | +#ifdef CONFIG_BLOCK | |
| 2489 | + | |
| 2489 | 2490 | /* |
| 2490 | 2491 | * return data direction, READ or WRITE |
| 2491 | 2492 | */ |
| @@ -510,7 +510,7 @@ static inline void wait_on_page_writeback(struct page *page) · 509 unmodified lines | ||
| 510 | 510 | extern void end_page_writeback(struct page *page); |
| 511 | 511 | void wait_for_stable_page(struct page *page); |
| 512 | 512 | |
| 513 | −void page_endio(struct page *page, int rw, int err); | |
| 513 | +void page_endio(struct page *page, int op, int err); | |
| 514 | 514 | |
| 515 | 515 | /* |
| 516 | 516 | * Add an arbitrary waiter to a page's wait queue |