Skip to content

Commit

Permalink
bdev: move ->bd_ro_warned to ->__bd_flags
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 3, 2024
1 parent ac2b6f9 commit 49a43da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,11 @@ static inline void bio_check_ro(struct bio *bio)
if (op_is_flush(bio->bi_opf) && !bio_sectors(bio))
return;

if (bio->bi_bdev->bd_ro_warned)
if (bdev_test_flag(bio->bi_bdev, BD_RO_WARNED))
return;

bio->bi_bdev->bd_ro_warned = true;
bdev_set_flag(bio->bi_bdev, BD_RO_WARNED);

/*
* Use ioctl to set underlying disk of raid/dm to read-only
* will trigger this.
Expand Down
2 changes: 1 addition & 1 deletion include/linux/blk_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ struct block_device {
#define BD_READ_ONLY (1u<<8) // read-only policy
#define BD_WRITE_HOLDER (1u<<9)
#define BD_HAS_SUBMIT_BIO (1u<<10)
#define BD_RO_WARNED (1u<<11)
dev_t bd_dev;
struct inode *bd_inode; /* will die */

Expand All @@ -69,7 +70,6 @@ struct block_device {
#ifdef CONFIG_FAIL_MAKE_REQUEST
bool bd_make_it_fail;
#endif
bool bd_ro_warned;
int bd_writers;
/*
* keep this out-of-line as it's both big and not needed in the fast
Expand Down

0 comments on commit 49a43da

Please sign in to comment.