Skip to contentSkip to conversation

loop: Fix discard_alignment default setting

PATCH Applied Lukas Czerner 2 participants 2 messages Dec 1, 2011 – Dec 2, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 loop: Fix discard_alignment default setting

discard_alignment is not relevant to the loop driver since it is supposed to be set as a workaround for the old sector 63 alignments. So set it to zero rather than block size.

---
 drivers/block/loop.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/loop.c +1 -1
index 68b205a..3d6dc86 100644
@@ -797,7 +797,7 @@ static void loop_config_discard(struct loop_device *lo)
 	}
 
 	q->limits.discard_granularity = inode->i_sb->s_blocksize;
-	q->limits.discard_alignment = inode->i_sb->s_blocksize;
+	q->limits.discard_alignment = 0;
 	q->limits.max_discard_sectors = UINT_MAX >> 9;
 	q->limits.discard_zeroes_data = 1;
 	queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
Signature · 1 line
1.7.4.4
Applied
#1 lore raw
Quoted 3 lines · Lukas Czerner

discard_alignment is not relevant to the loop driver since it is supposed to be set as a workaround for the old sector 63 alignments. So set it to zero rather than block size.

Thanks, applied.

Signature · 1 line
Jens Axboe