Skip to content

Commit 611c2a9

Browse files
author
Paul Dagnelie
committed
Feedback part 1
Signed-off-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
1 parent b3261f1 commit 611c2a9

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

module/zfs/metaslab.c

+9-7
Original file line numberDiff line numberDiff line change
@@ -1734,8 +1734,8 @@ metaslab_block_picker(zfs_range_tree_t *rt, uint64_t *cursor, uint64_t size,
17341734
*cursor = rt->rt_start;
17351735
zfs_btree_t *bt = &rt->rt_root;
17361736
zfs_btree_index_t where;
1737-
zfs_range_seg_t *rs = metaslab_block_find(bt, rt, *cursor, size, size,
1738-
&where);
1737+
zfs_range_seg_t *rs = metaslab_block_find(bt, rt, *cursor, size,
1738+
max_size, &where);
17391739
uint64_t first_found;
17401740
int count_searched = 0;
17411741

@@ -1885,7 +1885,7 @@ metaslab_df_alloc(metaslab_t *msp, uint64_t size, uint64_t max_size,
18851885
align = size & -size;
18861886
cursor = &msp->ms_lbas[highbit64(align) - 1];
18871887
offset = metaslab_block_picker(rt, cursor, size,
1888-
size, metaslab_df_max_search, found_size);
1888+
max_size, metaslab_df_max_search, found_size);
18891889
}
18901890
}
18911891

@@ -5164,16 +5164,17 @@ metaslab_group_alloc(metaslab_group_t *mg, zio_alloc_list_t *zal,
51645164

51655165
offset = metaslab_block_alloc(msp, asize, max_asize, txg,
51665166
actual_asize);
5167-
metaslab_trace_add(zal, mg, msp, *actual_asize, d, offset,
5168-
allocator);
51695167

51705168
if (offset != -1ULL) {
5169+
metaslab_trace_add(zal, mg, msp, *actual_asize, d,
5170+
offset, allocator);
51715171
/* Proactively passivate the metaslab, if needed */
51725172
if (activated)
51735173
metaslab_segment_may_passivate(msp);
51745174
mutex_exit(&msp->ms_lock);
51755175
break;
51765176
}
5177+
metaslab_trace_add(zal, mg, msp, asize, d, offset, allocator);
51775178
next:
51785179
ASSERT(msp->ms_loaded);
51795180

@@ -5399,10 +5400,11 @@ metaslab_alloc_dva_range(spa_t *spa, metaslab_class_t *mc, uint64_t psize,
53995400
uint64_t offset = metaslab_group_alloc(mg, zal, asize,
54005401
max_asize, txg, dva, d, allocator, try_hard,
54015402
&asize);
5402-
if (actual_psize)
5403-
*actual_psize = vdev_asize_to_psize_txg(vd, asize, txg);
54045403

54055404
if (offset != -1ULL) {
5405+
if (actual_psize)
5406+
*actual_psize = vdev_asize_to_psize_txg(vd,
5407+
asize, txg);
54065408
metaslab_class_rotate(mg, allocator, psize, B_TRUE);
54075409

54085410
DVA_SET_VDEV(&dva[d], vd->vdev_id);

module/zfs/zio.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -3200,7 +3200,7 @@ zio_write_gang_block(zio_t *pio, metaslab_class_t *mc)
32003200
/*
32013201
* Create and nowait the gang children. First, we try to do
32023202
* opportunistic allocations. If that fails to generate enough
3203-
* space, we fall back to normal zio_write calls.
3203+
* space, we fall back to normal zio_write calls for nested gang.
32043204
*/
32053205
for (int g = 0; resid != 0; g++) {
32063206
flags &= METASLAB_ASYNC_ALLOC;
@@ -3236,7 +3236,7 @@ zio_write_gang_block(zio_t *pio, metaslab_class_t *mc)
32363236
bp, gio->io_prop.zp_copies, txg, NULL,
32373237
flags, &cio_list, zio->io_allocator, NULL, &allocated_size);
32383238

3239-
boolean_t allocated = allocated_size != UINT64_MAX;
3239+
boolean_t allocated = error == 0;
32403240

32413241
uint64_t psize = allocated ? MIN(resid, allocated_size) :
32423242
min_size;
@@ -4964,7 +4964,6 @@ zio_checksum_generate(zio_t *zio)
49644964
ASSERT(checksum == ZIO_CHECKSUM_LABEL);
49654965
} else {
49664966
if (BP_IS_GANG(bp) && zio->io_child_type == ZIO_CHILD_GANG) {
4967-
zfs_dbgmsg("gang: %px", zio);
49684967
ASSERT(!IO_IS_ALLOCATING(zio));
49694968
checksum = ZIO_CHECKSUM_GANG_HEADER;
49704969
} else {

0 commit comments

Comments
 (0)