Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Documentation/admin-guide/blockdev/zoned_loop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ indicates the position of the write pointer of the zone.

When resetting a sequential zone, its backing file size is truncated to zero.
Conversely, for a zone finish operation, the backing file is truncated to the
zone size. With this, the maximum capacity of a zloop zoned block device created
can be larger configured to be larger than the storage space available on the
backing file system. Of course, for such configuration, writing more data than
the storage space available on the backing file system will result in write
errors.
zone capacity. With this, a zloop zoned block device can be configured with a
larger capacity than the storage space available on the backing file system. Of
course, for such configuration, writing more data than the storage space
available on the backing file system will result in write errors.

The zoned loop block device driver implements a complete zone transition state
machine. That is, zones can be empty, implicitly opened, explicitly opened,
Expand Down Expand Up @@ -71,8 +70,10 @@ follows.
=================== =========================================================
id Device number (the X in /dev/zloopX).
Default: automatically assigned.
capacity_mb Device total capacity in MiB. This is always rounded up
to the nearest higher multiple of the zone size.
capacity_mb Device total capacity in MiB. A smaller last zone is not
supported, so a capacity value that is not a multiple of
the zone size is rounded down to the closest multiple of
the zone size.
Default: 16384 MiB (16 GiB).
zone_size_mb Device zone size in MiB. Default: 256 MiB.
zone_capacity_mb Device zone capacity (must always be equal to or lower
Expand Down
8 changes: 4 additions & 4 deletions Documentation/block/biovecs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ bv_len by the number of bytes completed in that biovec.
In the new scheme of things, everything that must be mutated in order to
partially complete a bio is segregated into struct bvec_iter: bi_sector,
bi_size and bi_idx have been moved there; and instead of modifying bv_offset
and bv_len, struct bvec_iter has bi_bvec_done, which represents the number of
and bv_len, struct bvec_iter has bi_offset, which represents the number of
bytes completed in the current bvec.

There are a bunch of new helper macros for hiding the gory details - in
particular, presenting the illusion of partially completed biovecs so that
normal code doesn't have to deal with bi_bvec_done.
normal code doesn't have to deal with bi_offset.

* Driver code should no longer refer to biovecs directly; we now have
bio_iovec() and bio_iter_iovec() macros that return literal struct biovecs,
constructed from the raw biovecs but taking into account bi_bvec_done and
constructed from the raw biovecs but taking into account bi_offset and
bi_size.

bio_for_each_segment() has been updated to take a bvec_iter argument
Expand Down Expand Up @@ -101,7 +101,7 @@ Other implications:
I.e. instead of using bio_iovec_idx() (or bio->bi_iovec[bio->bi_idx]), you
now use bio_iter_iovec(), which takes a bvec_iter and returns a
literal struct bio_vec - constructed on the fly from the raw biovec but
taking into account bi_bvec_done (and bi_size).
taking into account bi_offset (and bi_size).

* bi_vcnt can't be trusted or relied upon by driver code - i.e. anything that
doesn't actually own the bio. The reason is twofold: firstly, it's not
Expand Down
4 changes: 2 additions & 2 deletions block/bfq-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ struct bfq_group *bfq_bio_bfqg(struct bfq_data *bfqd, struct bio *bio)
struct bfq_group *bfqg;

while (blkg) {
if (!blkg->online) {
if (!data_race(blkg->online)) {
blkg = blkg->parent;
continue;
}
Expand Down Expand Up @@ -1168,7 +1168,7 @@ static u64 bfqg_prfill_stat_recursive(struct seq_file *sf,
struct blkg_policy_data *pd;
struct bfq_stat *stat;

if (!pos_blkg->online)
if (!data_race(pos_blkg->online))
continue;

pd = blkg_to_pd(pos_blkg, &blkcg_policy_bfq);
Expand Down
10 changes: 2 additions & 8 deletions block/bio-integrity-auto.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ static void bio_integrity_verify_fn(struct work_struct *work)
bio_endio(bio);
}

#define BIP_CHECK_FLAGS (BIP_CHECK_GUARD | BIP_CHECK_REFTAG | BIP_CHECK_APPTAG)
static bool bip_should_check(struct bio_integrity_payload *bip)
{
return bip->bip_flags & BIP_CHECK_FLAGS;
}

/**
* __bio_integrity_endio - Integrity I/O completion function
* @bio: Protected bio
Expand All @@ -66,7 +60,7 @@ bool __bio_integrity_endio(struct bio *bio)
container_of(bip, struct bio_integrity_data, bip);

if (bio_op(bio) == REQ_OP_READ && !bio->bi_status &&
bip_should_check(bip)) {
(bip->bip_flags & BIP_CHECK_FLAGS)) {
INIT_WORK(&bid->work, bio_integrity_verify_fn);
queue_work(kintegrityd_wq, &bid->work);
return false;
Expand Down Expand Up @@ -99,7 +93,7 @@ void bio_integrity_prep(struct bio *bio, unsigned int action)
bio_integrity_setup_default(bio);

/* Auto-generate integrity metadata if this is a write */
if (bio_data_dir(bio) == WRITE && bip_should_check(&bid->bip))
if (bio_data_dir(bio) == WRITE && (bid->bip.bip_flags & BIP_CHECK_FLAGS))
bio_integrity_generate(bio);
else
bid->saved_bio_iter = bio->bi_iter;
Expand Down
6 changes: 5 additions & 1 deletion block/bio-integrity-fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ void fs_bio_integrity_free(struct bio *bio)

void fs_bio_integrity_generate(struct bio *bio)
{
if (fs_bio_integrity_alloc(bio))
if (fs_bio_integrity_alloc(bio) &&
(bio_integrity(bio)->bip_flags & BIP_CHECK_FLAGS))
bio_integrity_generate(bio);
}
EXPORT_SYMBOL_GPL(fs_bio_integrity_generate);
Expand All @@ -60,6 +61,9 @@ int fs_bio_integrity_verify(struct bio *bio, sector_t sector, unsigned int size)
.bi_size = size,
};

if (!bip || !(bip->bip_flags & BIP_CHECK_FLAGS))
return 0;

/*
* Reinitialize bip->bip_iter.
*
Expand Down
Loading
Loading