loop: Fix discard_alignment default setting
authorLukas Czerner <lczerner@redhat.com>
Fri, 2 Dec 2011 13:47:03 +0000 (14:47 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 2 Dec 2011 13:47:03 +0000 (14:47 +0100)
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.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c

index 5579fda279b497f25ae1f3a9d93a8998ced415be..1e888c9e85b3dd10a42238a6588dd4f0b2f7c9e1 100644 (file)
@@ -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);