Skip to content

Commit e9eaca6

Browse files
committed
Merge tag 'block-6.17-20250905' of git://git.kernel.dk/linux
Pull block fixes from Jens Axboe: - NVMe pull request via Keith - Fix protection information ref tag for device side gen/strip (Christoph) - MD pull request via Yu - fix data loss for writemostly in raid1 (Yu Kuai) - fix potentional data loss by skipping recovery (Li Nan) * tag 'block-6.17-20250905' of git://git.kernel.dk/linux: md: prevent incorrect update of resync/recovery offset md/raid1: fix data lost for writemostly rdev nvme: fix PI insert on write
2 parents c8ed9b5 + 743bf03 commit e9eaca6

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

drivers/md/md.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9125,6 +9125,11 @@ void md_do_sync(struct md_thread *thread)
91259125
}
91269126

91279127
action = md_sync_action(mddev);
9128+
if (action == ACTION_FROZEN || action == ACTION_IDLE) {
9129+
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
9130+
goto skip;
9131+
}
9132+
91289133
desc = md_sync_action_name(action);
91299134
mddev->last_sync_action = action;
91309135

drivers/md/raid1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio,
12251225
int i = 0;
12261226
struct bio *behind_bio = NULL;
12271227

1228-
behind_bio = bio_alloc_bioset(NULL, vcnt, 0, GFP_NOIO,
1228+
behind_bio = bio_alloc_bioset(NULL, vcnt, bio->bi_opf, GFP_NOIO,
12291229
&r1_bio->mddev->bio_set);
12301230

12311231
/* discard op, we don't support writezero/writesame yet */

drivers/nvme/host/core.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,15 @@ static void nvme_set_ref_tag(struct nvme_ns *ns, struct nvme_command *cmnd,
903903
u32 upper, lower;
904904
u64 ref48;
905905

906+
/* only type1 and type 2 PI formats have a reftag */
907+
switch (ns->head->pi_type) {
908+
case NVME_NS_DPS_PI_TYPE1:
909+
case NVME_NS_DPS_PI_TYPE2:
910+
break;
911+
default:
912+
return;
913+
}
914+
906915
/* both rw and write zeroes share the same reftag format */
907916
switch (ns->head->guard_type) {
908917
case NVME_NVM_NS_16B_GUARD:
@@ -942,13 +951,7 @@ static inline blk_status_t nvme_setup_write_zeroes(struct nvme_ns *ns,
942951

943952
if (nvme_ns_has_pi(ns->head)) {
944953
cmnd->write_zeroes.control |= cpu_to_le16(NVME_RW_PRINFO_PRACT);
945-
946-
switch (ns->head->pi_type) {
947-
case NVME_NS_DPS_PI_TYPE1:
948-
case NVME_NS_DPS_PI_TYPE2:
949-
nvme_set_ref_tag(ns, cmnd, req);
950-
break;
951-
}
954+
nvme_set_ref_tag(ns, cmnd, req);
952955
}
953956

954957
return BLK_STS_OK;
@@ -1039,6 +1042,7 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns,
10391042
if (WARN_ON_ONCE(!nvme_ns_has_pi(ns->head)))
10401043
return BLK_STS_NOTSUPP;
10411044
control |= NVME_RW_PRINFO_PRACT;
1045+
nvme_set_ref_tag(ns, cmnd, req);
10421046
}
10431047

10441048
if (bio_integrity_flagged(req->bio, BIP_CHECK_GUARD))

0 commit comments

Comments
 (0)