Due to the way /etc/udev/rules.d/60-io-scheduler.rules is
written, it doesn't check if the I/O scheduler is already
set correctly or not, before resetting it. Thus, a condition
was added to each "action", in such a way that only the
correct "action" is executed.
Using gparted/sgdisk in sysinv causes disks to be "reprobed"
by the kernel every minute, so the disk I/O scheduler is reset
multiple times. This can be seen by running the command below:
sysadmin@controller-0:~$ ( while true; do sched="$(cat /sys/block
/sda/queue/scheduler)"; if test "${sched}" != "${last_sched}";
then echo "$(date -Is): change: ${sched}"; last_sched="${sched}";
fi; done )
Test Plan:
PASS: It was checked disk I/O scheduler (sys/block/sda/queue
/scheduler) is not resetting every minute, multiple times on
AIO-SX fresh install.
Closes-Bug: 1996822
Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Change-Id: Ic4a9b963d00393b591fd23f2c1224ad6b8740e5e