Re: [PATCH] backend: fix switch_ioscheduler()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/14/21 5:10 AM, Damien Le Moal wrote:
> If the first file specified for a job is not a block device file, the
> ioscheduler option cannot be used. Trying to use this option can cause a
> crash as that file du (struct disk_util) field is NULL. Prevent such
> crash and signal the error by testing the file type, allowing only files
> with the type FIO_TYPE_BLOCK to proceed with switching the IO scheduler.

I wonder if this shouldn't be a for_each_file() loop, and just skipping
file types that aren't FIO_TYPE_BLOCK, moving the actual switching into
a helper?

-- 
Jens Axboe




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux