Skip to content

Commit

Permalink
btrfs: submit superblock io with REQ_META and REQ_PRIO
Browse files Browse the repository at this point in the history
The superblock is also metadata of the filesystem so the relevant IO
should be tagged as such. We also tag it as high priority, as it's the
last block committed for metadata from a given transaction. Any delays
would effectively block the whole transaction, also blocking any other
operation holding the device_list_mutex.

Reviewed-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
David Sterba committed Aug 22, 2017
1 parent dc59215 commit db95c87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3433,9 +3433,10 @@ static int write_dev_supers(struct btrfs_device *device,
*/
if (i == 0) {
ret = btrfsic_submit_bh(REQ_OP_WRITE,
REQ_SYNC | REQ_FUA, bh);
REQ_SYNC | REQ_FUA | REQ_META | REQ_PRIO, bh);
} else {
ret = btrfsic_submit_bh(REQ_OP_WRITE, REQ_SYNC, bh);
ret = btrfsic_submit_bh(REQ_OP_WRITE,
REQ_SYNC | REQ_META | REQ_PRIO, bh);
}
if (ret)
errors++;
Expand Down

0 comments on commit db95c87

Please sign in to comment.