ext4 bugfixes for v3.11-rc4

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABCAAGBQJR+YUoAAoJENNvdpvBGATwxsgQAJzxe8x1SWW8jrvasMELW3bS
 I7gl3lu789GROmZo5MI6+XI1DSCjHcMTisoPnPGx8q9LNhiYQGjp9Loxgl+L+Cem
 wbDfkSHrhxtDoEw2rdpPb/hFHOpsv8t6TT53GVbdc5l/lxwyvdrblXxhWbLuTRCQ
 G0X2VoxvTph7SyVPpRqoU4U99vW3g6LRI0dsxyU8kLc/kp7/t89gwh6Gj0wlb6tb
 4pswvEuxK4HauMPjajCIaEeGpQoHbvCVpB4P9HvEtL/wklc5hNIAWy5+KYjMFWil
 8Vc6RsJv6DZc66z+X4PT1oYrx6bkhNKNRGBETV2/dzeLU/7o2ttUIQ0vlOlN9gKV
 xSne19OKwqhhRMuWrc3LDzunlFiLex2zHbZJVDOeKNXmEJVpO9ZPVkvpoi/g0vOE
 DPwcc89J+763CVmXu8uyPqgQRfJTp2dXNggP3lINCDi1mFayrBqR0S6rQ1B2m/6R
 8HYDjJ6gBpXBcs0FTGh1cfbpI8GpPx9Xu3Q/FtjvczEXUO3831KCm+k7O3cUjB72
 I7I3wmyYQvUanOc39fg+EZ0cXpiSIZG4Mjv+8vWgADFlCMUKMaC+vp2PuKmBxTuk
 7dAkxKr2kXfMirGWF1R/vo/CaKnCWmJbAJDFJ8Mt/Nk3zn3NOl/kCRtxndlj7k+m
 /s8DHlVLyD8dgvzRO9gp
 =xqB3
 -----END PGP SIGNATURE-----

Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

Pull ext4 bugfixes from Ted Ts'o.

Misc ext4 fixes, delayed by Ted moving mail servers and email getting
marked as spam due to bad spf records.

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: add WARN_ON to check the length of allocated blocks
  ext4: fix retry handling in ext4_ext_truncate()
  ext4: destroy ext4_es_cachep on module unload
  ext4: make sure group number is bumped after a inode allocation race
This commit is contained in:
Linus Torvalds 2013-08-08 09:38:19 -07:00
commit 55f5bfd4c9
4 changed files with 25 additions and 27 deletions

View File

@ -4412,7 +4412,7 @@ void ext4_ext_truncate(handle_t *handle, struct inode *inode)
retry: retry:
err = ext4_es_remove_extent(inode, last_block, err = ext4_es_remove_extent(inode, last_block,
EXT_MAX_BLOCKS - last_block); EXT_MAX_BLOCKS - last_block);
if (err == ENOMEM) { if (err == -ENOMEM) {
cond_resched(); cond_resched();
congestion_wait(BLK_RW_ASYNC, HZ/50); congestion_wait(BLK_RW_ASYNC, HZ/50);
goto retry; goto retry;

View File

@ -734,11 +734,8 @@ repeat_in_this_group:
ino = ext4_find_next_zero_bit((unsigned long *) ino = ext4_find_next_zero_bit((unsigned long *)
inode_bitmap_bh->b_data, inode_bitmap_bh->b_data,
EXT4_INODES_PER_GROUP(sb), ino); EXT4_INODES_PER_GROUP(sb), ino);
if (ino >= EXT4_INODES_PER_GROUP(sb)) { if (ino >= EXT4_INODES_PER_GROUP(sb))
if (++group == ngroups) goto next_group;
group = 0;
continue;
}
if (group == 0 && (ino+1) < EXT4_FIRST_INO(sb)) { if (group == 0 && (ino+1) < EXT4_FIRST_INO(sb)) {
ext4_error(sb, "reserved inode found cleared - " ext4_error(sb, "reserved inode found cleared - "
"inode=%lu", ino + 1); "inode=%lu", ino + 1);
@ -769,6 +766,9 @@ repeat_in_this_group:
goto got; /* we grabbed the inode! */ goto got; /* we grabbed the inode! */
if (ino < EXT4_INODES_PER_GROUP(sb)) if (ino < EXT4_INODES_PER_GROUP(sb))
goto repeat_in_this_group; goto repeat_in_this_group;
next_group:
if (++group == ngroups)
group = 0;
} }
err = -ENOSPC; err = -ENOSPC;
goto out; goto out;

View File

@ -555,14 +555,13 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
int ret; int ret;
unsigned long long status; unsigned long long status;
#ifdef ES_AGGRESSIVE_TEST if (unlikely(retval != map->m_len)) {
if (retval != map->m_len) { ext4_warning(inode->i_sb,
printk("ES len assertion failed for inode: %lu " "ES len assertion failed for inode "
"retval %d != map->m_len %d " "%lu: retval %d != map->m_len %d",
"in %s (lookup)\n", inode->i_ino, retval, inode->i_ino, retval, map->m_len);
map->m_len, __func__); WARN_ON(1);
} }
#endif
status = map->m_flags & EXT4_MAP_UNWRITTEN ? status = map->m_flags & EXT4_MAP_UNWRITTEN ?
EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN; EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN;
@ -656,14 +655,13 @@ found:
int ret; int ret;
unsigned long long status; unsigned long long status;
#ifdef ES_AGGRESSIVE_TEST if (unlikely(retval != map->m_len)) {
if (retval != map->m_len) { ext4_warning(inode->i_sb,
printk("ES len assertion failed for inode: %lu " "ES len assertion failed for inode "
"retval %d != map->m_len %d " "%lu: retval %d != map->m_len %d",
"in %s (allocation)\n", inode->i_ino, retval, inode->i_ino, retval, map->m_len);
map->m_len, __func__); WARN_ON(1);
} }
#endif
/* /*
* If the extent has been zeroed out, we don't need to update * If the extent has been zeroed out, we don't need to update
@ -1637,14 +1635,13 @@ add_delayed:
int ret; int ret;
unsigned long long status; unsigned long long status;
#ifdef ES_AGGRESSIVE_TEST if (unlikely(retval != map->m_len)) {
if (retval != map->m_len) { ext4_warning(inode->i_sb,
printk("ES len assertion failed for inode: %lu " "ES len assertion failed for inode "
"retval %d != map->m_len %d " "%lu: retval %d != map->m_len %d",
"in %s (lookup)\n", inode->i_ino, retval, inode->i_ino, retval, map->m_len);
map->m_len, __func__); WARN_ON(1);
} }
#endif
status = map->m_flags & EXT4_MAP_UNWRITTEN ? status = map->m_flags & EXT4_MAP_UNWRITTEN ?
EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN; EXTENT_STATUS_UNWRITTEN : EXTENT_STATUS_WRITTEN;

View File

@ -5481,6 +5481,7 @@ static void __exit ext4_exit_fs(void)
kset_unregister(ext4_kset); kset_unregister(ext4_kset);
ext4_exit_system_zone(); ext4_exit_system_zone();
ext4_exit_pageio(); ext4_exit_pageio();
ext4_exit_es();
} }
MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others"); MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");