RE: [PATCH] ext4: use EINVAL if not a regular file in ext4_fallocate()

Namjae Jeon
2014-04-23T08:35:52Z

Hi Zheng.
IMHO, EOPNOTSUPP should be used where the operation is not yet implemented but
there is some chance that it could be implemented in future.
for example, it is ok for FS which has not yet implemented punch hole to
return EOPNOTSUPP as they could implement it in future. but for the cases where
it does not make sense to implement the operation, for example punching hole
for non regular files does not make any sense, it is better to use EINVAL.
On these lines, I agree that returning EOPNOTSUPP for collapse range in case of
non-extent based file is ok, as it is plausible to implemet collapse range for
non extent files in future.

Thanks for your opinion!