Re: [PATCH 3/8] Add assert(0) to DDIR_DATASYNC sync path if fdatasync(2) is unsupported

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

 



On Tue, Apr 04 2017, kusumi.tomohiro@xxxxxxxxx wrote:
> From: Tomohiro Kusumi <tkusumi@xxxxxxxxxx>
> 
> If ddir is DDIR_DATASYNC, it means fio supports fdatasync(2), or it
> at least compiled on ./configure. If a platform without fdatasync(2)
> happens to take DDIR_DATASYNC path in do_io_u_sync(), it's simply wrong
> (because ddir should never be DDIR_DATASYNC due to td->o.fdatasync_blocks == 0)
> thus should be aborted rather than continue with EINVAL.
> 
> This commit also leaves the existing code from #else path to avoid
> compilers complain for uninitialized ret variable.

EINVAL should cause termination, I don't think there's any reason to use
assert here. In general, if we can handle even cases that we think
should not occur, then we should do so instead of dumping core.

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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