Fixup for a minor 0 byte file size case
authorTomohiro Kusumi <tkusumi@tuxera.com>
Tue, 7 Mar 2017 20:12:57 +0000 (22:12 +0200)
committerJens Axboe <axboe@fb.com>
Fri, 10 Mar 2017 21:43:37 +0000 (14:43 -0700)
commitc4aa2d0825c180dd96ffff8ce1d74b967f3a0f4a
tree8a2ebc3593ba3fa1d1d14b6cdd4506f1017ab20e
parent08c44a557efc1cf301c39b5a81f8db4ccd7baa2d
Fixup for a minor 0 byte file size case

When a file size calculated by (size / nrfiles) happens to be 0 in
setup_files(), it simply sets ->file_size to ->real_file_size which
means the size is set to the existing file size (if any) or 0.

Add log_info() to show that it's been set that way, and also 0 byte
file isn't likely to be created in the first place. Also add a check
to avoid negative file size.

This usually doesn't happen unless one tries to make it happen by
for e.g. using a small size= and large nrfiles= options.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
HOWTO
filesetup.c