Skip to content

Commit

Permalink
ext4: correct ext4_punch_hole return codes
Browse files Browse the repository at this point in the history
ext4_punch_hole returns -ENOTSUPP but it should be using -EOPNOTSUPP

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Allison Henderson authored and Theodore Ts'o committed Mar 22, 2012
1 parent afcff5d commit 7335519
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3340,16 +3340,16 @@ int ext4_punch_hole(struct file *file, loff_t offset, loff_t length)
{
struct inode *inode = file->f_path.dentry->d_inode;
if (!S_ISREG(inode->i_mode))
return -ENOTSUPP;
return -EOPNOTSUPP;

if (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) {
/* TODO: Add support for non extent hole punching */
return -ENOTSUPP;
return -EOPNOTSUPP;
}

if (EXT4_SB(inode->i_sb)->s_cluster_ratio > 1) {
/* TODO: Add support for bigalloc file systems */
return -ENOTSUPP;
return -EOPNOTSUPP;
}

return ext4_ext_punch_hole(file, offset, length);
Expand Down

0 comments on commit 7335519

Please sign in to comment.