On Fri, 17 Aug 2012 12:00:15 +0800 Shaohua Li <shli@xxxxxxxxxx> wrote: > > > > This is a semi-automatic email about new static checker warnings. > > > > The patch d61b764704ca: "md: raid 10 supports TRIM" from Aug 15, > > 2012, leads to the following Smatch complaint: > > > > drivers/md/raid10.c:3510 run() > > warn: variable dereferenced before check 'mddev->queue' (see line 3508) > > > > drivers/md/raid10.c > > 3507 > > 3508 blk_queue_max_discard_sectors(mddev->queue, mddev->chunk_sectors); > > ^^^^^^^^^^^^ > > New dereference. > > > > 3509 chunk_size = mddev->chunk_sectors<< 9; > > 3510 if (mddev->queue) { > > ^^^^^^^^^^^^ > > Old check. > > > > 3511 blk_queue_io_min(mddev->queue, chunk_size); > > 3512 if (conf->geo.raid_disks % conf->geo.near_copies) > > Thanks! Neil, this is the updated patch. If you prefer a fix against original > patch, please let me know. > > > Subject: md: raid 10 supports TRIM > > This makes md raid 10 support TRIM. > If one disk supports discard and another not, or one has discard_zero_data and > another not, there could be inconsistent between data from such disks. But this > should not matter, discarded data is useless. This will add extra copy in rebuild > though. > > Signed-off-by: Shaohua Li <shli@xxxxxxxxxxxx> Applied, thanks. NeilBrown
Attachment:
signature.asc
Description: PGP signature