ext4: use EINVAL if not a regular file in ext4_collapse_range()
authorTheodore Ts'o <tytso@mit.edu>
Fri, 18 Apr 2014 15:52:11 +0000 (11:52 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 18 Apr 2014 15:52:11 +0000 (11:52 -0400)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c

index 2f49b12a4c40f66b6ec2700a5655d16bc30fc5cf..9b9251adb400771d3827059ffbad06d764cb37fc 100644 (file)
@@ -5404,7 +5404,7 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
                return -EINVAL;
 
        if (!S_ISREG(inode->i_mode))
-               return -EOPNOTSUPP;
+               return -EINVAL;
 
        trace_ext4_collapse_range(inode, offset, len);