[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210910041713.4722760a@thinkpad>
Date: Fri, 10 Sep 2021 04:17:13 +0200
From: Marek BehĂșn <kabel@...nel.org>
To: Ian Pilcher <arequipeno@...il.com>
Cc: axboe@...nel.dk, pavel@....cz, linux-leds@...r.kernel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
gregkh@...uxfoundation.org
Subject: Re: [PATCH v2 09/15] leds: trigger: blkdev: Check devices for
activity and blink LEDs
On Thu, 9 Sep 2021 17:25:07 -0500
Ian Pilcher <arequipeno@...il.com> wrote:
> +static void blkdev_update_disk(struct ledtrig_blkdev_disk *const disk,
> + const unsigned int generation)
> +{
> + const struct block_device *const part0 = disk->gd->part0;
> + const unsigned long read_ios = part_stat_read(part0, ios[STAT_READ]);
> + const unsigned long write_ios = part_stat_read(part0, ios[STAT_WRITE])
> + + part_stat_read(part0, ios[STAT_DISCARD])
> + + part_stat_read(part0, ios[STAT_FLUSH]);
So your code allows me to use a partition block device (like sda2) to
register with the blkdev LED trigger, but when I do this, the code will
disregard that I just want the LED to blink on activity on that one
partition. Instead you will blink for whole sda, since you are looking
at stats of only part0.
Am I right?
If so, this in unacceptable. The whole point of blkdev trigger is that
you can reliably use it for any block device, and then it will blink
the LED for that device, be it partition or whole disk.
Marek
Powered by blists - more mailing lists