Red Hat Bugzilla – Bug 645824
ext4: Don't error out the fs if the user tries to make a file too big
Last modified: 2016-04-18 01:55:40 EDT
Description of problem: ext4: Don't error out the fs if the user tries to make a file too big Version-Release number of selected component (if applicable): V6.0 How reproducible: do_truncate() can call ext4_setattr() (via notify_change()). And, ext4_setattr() can return with -EFBIG if the argument(length) of do_truncate() is more than sbi->s_bitmap_maxbytes. At that time, it also calls ext4_std_error() with -EFBIG. Besides, a panic happens when ext4_setattr() returns with -EFBIG after we mount an ext4 filesystem with errors=panic. The following steps(Step to Reproduce) can make this problem easily. This problem is in: 5482 if (attr->ia_valid & ATTR_SIZE) { 5483 if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) { 5484 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); 5485 5486 if (attr->ia_size > sbi->s_bitmap_maxbytes) { 5487 error = -EFBIG; 5488 goto err_out; 5489 } 5490 } 5491 } 5543 err_out: 5544 ext4_std_error(inode->i_sb, error); 5545 if (!error) 5546 error = rc; 5547 return error; (because ext4_setattr() calls ext4_std_error() when error == -EFBIG) This fix is already included in 2.6.36-rc1. (http://marc.info/?l=git-commits-head&m=128121841924078&w=2) Please apply it. Additional info:
filesystem package (basic system directory structure) has nothing to do with ext4 filesystem. Reassigning to kernel.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=0c095c7f113e9fd05913d6e1b2cccbe356be039e
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
copied from http://marc.info/?l=git-commits-head&m=128121841924078&w=2 , this might explain how to reproduce the bug. 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.
Patch(es) available on kernel-2.6.32-89.el6
Created attachment 473895 [details] script that duplicates/shows issue
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-0542.html