Avoid irrelevant "offset extend ends" error message
authorTomohiro Kusumi <tkusumi@tuxera.com>
Sun, 19 Feb 2017 18:22:19 +0000 (20:22 +0200)
committerJens Axboe <axboe@fb.com>
Mon, 20 Feb 2017 00:57:43 +0000 (17:57 -0700)
commit957c81b9d0d090162366dcf0bec308afb2400464
tree65162169666319e652c16d64d91a82255c569e16
parent5be9bf098d3766a8f27d446d82911c5ef0153676
Avoid irrelevant "offset extend ends" error message

When ->real_file_size is -1 due to unsupported file type/etc,
"if (f->file_offset > f->real_file_size)" conditional is always true
(unless ->file_offset is also negative which is an another problem),
and results in irrelevant error message. To avoid this, just return
1 without showing the irrelevant error message and then return 1.

It's still possible that char_size() returns with ->real_file_size
set to -1 (though platform dependent), and the irrelevant error
message be shown.

Also this message itself isn't likely to show any relevant info
due to the timing it's been called as mentioned in a comment.

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