Skip to content

Commit

Permalink
ext4: Don't error out the fs if the user tries to make a file too big
Browse files Browse the repository at this point in the history
If the user attempts to make a non-extent-mapped file to be too large,
return EFBIG, but don't call ext4_std_err() which will end up marking
the file system as containing an error.

Thanks to Toshiyuki Okajima-san at Fujitsu for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Theodore Ts'o committed Jul 27, 2010
1 parent 506bf2d commit 0c095c7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -5472,10 +5472,8 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);

if (attr->ia_size > sbi->s_bitmap_maxbytes) {
error = -EFBIG;
goto err_out;
}
if (attr->ia_size > sbi->s_bitmap_maxbytes)
return -EFBIG;
}
}

Expand Down

0 comments on commit 0c095c7

Please sign in to comment.