File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -514,10 +514,11 @@ static inline void bio_check_ro(struct bio *bio)
514514 if (op_is_flush (bio -> bi_opf ) && !bio_sectors (bio ))
515515 return ;
516516
517- if (bio -> bi_bdev -> bd_ro_warned )
517+ if (bdev_test_flag ( bio -> bi_bdev , BD_RO_WARNED ) )
518518 return ;
519519
520- bio -> bi_bdev -> bd_ro_warned = true;
520+ bdev_set_flag (bio -> bi_bdev , BD_RO_WARNED );
521+
521522 /*
522523 * Use ioctl to set underlying disk of raid/dm to read-only
523524 * will trigger this.
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ struct block_device {
5050#define BD_READ_ONLY (1u<<8) // read-only policy
5151#define BD_WRITE_HOLDER (1u<<9)
5252#define BD_HAS_SUBMIT_BIO (1u<<10)
53+ #define BD_RO_WARNED (1u<<11)
5354 dev_t bd_dev ;
5455 struct inode * bd_inode ; /* will die */
5556
@@ -69,7 +70,6 @@ struct block_device {
6970#ifdef CONFIG_FAIL_MAKE_REQUEST
7071 bool bd_make_it_fail ;
7172#endif
72- bool bd_ro_warned ;
7373 int bd_writers ;
7474 /*
7575 * keep this out-of-line as it's both big and not needed in the fast
You can’t perform that action at this time.
0 commit comments