Re: [PATCH] backend: fix switch_ioscheduler()

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

 



On 2021/04/14 23:23, Jens Axboe wrote:
> 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?
> 

Indeed, that would be more correct. Will send a v2.

-- 
Damien Le Moal
Western Digital Research




[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