Bug 1146152

Summary: fallocate fails with keep size mode unsupported when fs doesn't support FALLOC_FL_PUNCH_HOLE
Product: Red Hat Enterprise Linux 6 Reporter: Federico Simoncelli <fsimonce>
Component: util-linux-ngAssignee: Karel Zak <kzak>
Status: CLOSED NEXTRELEASE QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.6   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-25 13:35:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Federico Simoncelli 2014-09-24 15:09:50 UTC
Description of problem:
fallocate fails with keep size mode unsupported when fs doesn't support FALLOC_FL_PUNCH_HOLE:

$ truncate -s 1024 test1
$ fallocate -p -o 0 -l 1024 test1
fallocate: keep size mode (-n option) unsupported

The error should be the same as for regular fallocate:

$ fallocate -o 0 -l 1024 test1 
fallocate: test1: fallocate failed: Operation not supported

Version-Release number of selected component (if applicable):
util-linux-ng-2.17.2-12.14.el6_5.x86_64

How reproducible:
100%

Steps to Reproduce:
1. try to run fallocate -p on a fs that doesn't support fallocate (e.g. nfs v3/4)

Actual results:
Fail with a wrong message: "fallocate: keep size mode (-n option) unsupported"

Expected results:
Fail with correct message: "fallocate failed: Operation not supported"

Comment 2 Karel Zak 2015-08-25 13:35:17 UTC
fallocate syscall differentiate between unsupported fallocate (=ENOSYS) and unsupported FALLOC_FL_KEEP_SIZE flag (=EOPNOTSUPP).

I think we want to make a difference between these two errors, but "(-n option)" in the error message is mistake as the KEEP_SIZE flag is generic and used in more situation than only for "-n".

I'm going to fix the error message (remove "-n ..") in the upstream tree. I don't think this is so critical issue that we have to fix it in RHEL update (reopen if do not agree).

Thanks for your report.