Skip to content

Commit

Permalink
Set the maximum ZVOL transfer size correctly
Browse files Browse the repository at this point in the history
ZoL had been setting max_sectors to UINT_MAX, but until Linux 3.19, it
the kernel artifically capped it at 1024 (BLK_DEF_MAX_SECTORS).
This cap was removed in torvalds/linux@34b48db.  This patch changes
it to DMU_MAX_ACCESS (in sectors) and also changes the ASSERT in
dmu_tx_hold_write() to allow the maximum transfer size.

Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#3212
  • Loading branch information
dweeezil authored and DeHackEd committed Apr 4, 2015
1 parent f48c3e6 commit 9eee14b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion module/zfs/dmu_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ dmu_tx_hold_write(dmu_tx_t *tx, uint64_t object, uint64_t off, int len)
dmu_tx_hold_t *txh;

ASSERT(tx->tx_txg == 0);
ASSERT(len < DMU_MAX_ACCESS);
ASSERT(len <= DMU_MAX_ACCESS);
ASSERT(len == 0 || UINT64_MAX - off >= len - 1);

txh = dmu_tx_hold_object_impl(tx, tx->tx_objset,
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/zvol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ __zvol_create_minor(const char *name, boolean_t ignore_snapdev)

set_capacity(zv->zv_disk, zv->zv_volsize >> 9);

blk_queue_max_hw_sectors(zv->zv_queue, UINT_MAX);
blk_queue_max_hw_sectors(zv->zv_queue, DMU_MAX_ACCESS / 512);
blk_queue_max_segments(zv->zv_queue, UINT16_MAX);
blk_queue_max_segment_size(zv->zv_queue, UINT_MAX);
blk_queue_physical_block_size(zv->zv_queue, zv->zv_volblocksize);
Expand Down

0 comments on commit 9eee14b

Please sign in to comment.