|
@@ -314,7 +314,10 @@ static int ext4_block_to_path(struct inode *inode,
|
|
offsets[n++] = i_block & (ptrs - 1);
|
|
offsets[n++] = i_block & (ptrs - 1);
|
|
final = ptrs;
|
|
final = ptrs;
|
|
} else {
|
|
} else {
|
|
- ext4_warning(inode->i_sb, "ext4_block_to_path", "block > big");
|
|
|
|
|
|
+ ext4_warning(inode->i_sb, "ext4_block_to_path",
|
|
|
|
+ "block %u > max",
|
|
|
|
+ i_block + direct_blocks +
|
|
|
|
+ indirect_blocks + double_blocks);
|
|
}
|
|
}
|
|
if (boundary)
|
|
if (boundary)
|
|
*boundary = final - 1 - (i_block & (ptrs - 1));
|
|
*boundary = final - 1 - (i_block & (ptrs - 1));
|
|
@@ -3092,6 +3095,17 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
|
|
ext4_journal_stop(handle);
|
|
ext4_journal_stop(handle);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (attr->ia_valid & ATTR_SIZE) {
|
|
|
|
+ if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) {
|
|
|
|
+ struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
|
|
|
|
+
|
|
|
|
+ if (attr->ia_size > sbi->s_bitmap_maxbytes) {
|
|
|
|
+ error = -EFBIG;
|
|
|
|
+ goto err_out;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if (S_ISREG(inode->i_mode) &&
|
|
if (S_ISREG(inode->i_mode) &&
|
|
attr->ia_valid & ATTR_SIZE && attr->ia_size < inode->i_size) {
|
|
attr->ia_valid & ATTR_SIZE && attr->ia_size < inode->i_size) {
|
|
handle_t *handle;
|
|
handle_t *handle;
|