<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/ext4/balloc.c, branch linux-3.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-11-14T18:10:30Z</updated>
<entry>
<title>ext4: move error report out of atomic context in ext4_init_block_bitmap()</title>
<updated>2014-11-14T18:10:30Z</updated>
<author>
<name>Dmitry Monakhov</name>
</author>
<published>2014-10-13T07:42:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dcd14a65c2cfdf2adbd8b13a60ae894dbe3ec291'/>
<id>urn:sha1:dcd14a65c2cfdf2adbd8b13a60ae894dbe3ec291</id>
<content type='text'>
commit aef4885ae14f1df75b58395c5314d71f613d26d9 upstream.

Error report likely result in IO so it is bad idea to do it from
atomic context.

This patch should fix following issue:

BUG: sleeping function called from invalid context at include/linux/buffer_head.h:349
in_atomic(): 1, irqs_disabled(): 0, pid: 137, name: kworker/u128:1
5 locks held by kworker/u128:1/137:
 #0:  ("writeback"){......}, at: [&lt;ffffffff81085618&gt;] process_one_work+0x228/0x4d0
 #1:  ((&amp;(&amp;wb-&gt;dwork)-&gt;work)){......}, at: [&lt;ffffffff81085618&gt;] process_one_work+0x228/0x4d0
 #2:  (jbd2_handle){......}, at: [&lt;ffffffff81242622&gt;] start_this_handle+0x712/0x7b0
 #3:  (&amp;ei-&gt;i_data_sem){......}, at: [&lt;ffffffff811fa387&gt;] ext4_map_blocks+0x297/0x430
 #4:  (&amp;(&amp;bgl-&gt;locks[i].lock)-&gt;rlock){......}, at: [&lt;ffffffff811f3180&gt;] ext4_read_block_bitmap_nowait+0x5d0/0x630
CPU: 3 PID: 137 Comm: kworker/u128:1 Not tainted 3.17.0-rc2-00184-g82752e4 #165
Hardware name: Intel Corporation W2600CR/W2600CR, BIOS SE5C600.86B.99.99.x028.061320111235 06/13/2011
Workqueue: writeback bdi_writeback_workfn (flush-1:0)
 0000000000000411 ffff880813777288 ffffffff815c7fdc ffff880813777288
 ffff880813a8bba0 ffff8808137772a8 ffffffff8108fb30 ffff880803e01e38
 ffff880803e01e38 ffff8808137772c8 ffffffff811a8d53 ffff88080ecc6000
Call Trace:
 [&lt;ffffffff815c7fdc&gt;] dump_stack+0x51/0x6d
 [&lt;ffffffff8108fb30&gt;] __might_sleep+0xf0/0x100
 [&lt;ffffffff811a8d53&gt;] __sync_dirty_buffer+0x43/0xe0
 [&lt;ffffffff811a8e03&gt;] sync_dirty_buffer+0x13/0x20
 [&lt;ffffffff8120f581&gt;] ext4_commit_super+0x1d1/0x230
 [&lt;ffffffff8120fa03&gt;] save_error_info+0x23/0x30
 [&lt;ffffffff8120fd06&gt;] __ext4_error+0xb6/0xd0
 [&lt;ffffffff8120f260&gt;] ? ext4_group_desc_csum+0x140/0x190
 [&lt;ffffffff811f2d8c&gt;] ext4_read_block_bitmap_nowait+0x1dc/0x630
 [&lt;ffffffff8122e23a&gt;] ext4_mb_init_cache+0x21a/0x8f0
 [&lt;ffffffff8113ae95&gt;] ? lru_cache_add+0x55/0x60
 [&lt;ffffffff8112e16c&gt;] ? add_to_page_cache_lru+0x6c/0x80
 [&lt;ffffffff8122eaa0&gt;] ext4_mb_init_group+0x190/0x280
 [&lt;ffffffff8122ec51&gt;] ext4_mb_good_group+0xc1/0x190
 [&lt;ffffffff8123309a&gt;] ext4_mb_regular_allocator+0x17a/0x410
 [&lt;ffffffff8122c821&gt;] ? ext4_mb_use_preallocated+0x31/0x380
 [&lt;ffffffff81233535&gt;] ? ext4_mb_new_blocks+0x205/0x8e0
 [&lt;ffffffff8116ed5c&gt;] ? kmem_cache_alloc+0xfc/0x180
 [&lt;ffffffff812335b0&gt;] ext4_mb_new_blocks+0x280/0x8e0
 [&lt;ffffffff8116f2c4&gt;] ? __kmalloc+0x144/0x1c0
 [&lt;ffffffff81221797&gt;] ? ext4_find_extent+0x97/0x320
 [&lt;ffffffff812257f4&gt;] ext4_ext_map_blocks+0xbc4/0x1050
 [&lt;ffffffff811fa387&gt;] ? ext4_map_blocks+0x297/0x430
 [&lt;ffffffff811fa3ab&gt;] ext4_map_blocks+0x2bb/0x430
 [&lt;ffffffff81200e43&gt;] ? ext4_init_io_end+0x23/0x50
 [&lt;ffffffff811feb44&gt;] ext4_writepages+0x564/0xaf0
 [&lt;ffffffff815cde3b&gt;] ? _raw_spin_unlock+0x2b/0x40
 [&lt;ffffffff810ac7bd&gt;] ? lock_release_non_nested+0x2fd/0x3c0
 [&lt;ffffffff811a009e&gt;] ? writeback_sb_inodes+0x10e/0x490
 [&lt;ffffffff811a009e&gt;] ? writeback_sb_inodes+0x10e/0x490
 [&lt;ffffffff811377e3&gt;] do_writepages+0x23/0x40
 [&lt;ffffffff8119c8ce&gt;] __writeback_single_inode+0x9e/0x280
 [&lt;ffffffff811a026b&gt;] writeback_sb_inodes+0x2db/0x490
 [&lt;ffffffff811a0664&gt;] wb_writeback+0x174/0x2d0
 [&lt;ffffffff810ac359&gt;] ? lock_release_holdtime+0x29/0x190
 [&lt;ffffffff811a0863&gt;] wb_do_writeback+0xa3/0x200
 [&lt;ffffffff811a0a40&gt;] bdi_writeback_workfn+0x80/0x230
 [&lt;ffffffff81085618&gt;] ? process_one_work+0x228/0x4d0
 [&lt;ffffffff810856cd&gt;] process_one_work+0x2dd/0x4d0
 [&lt;ffffffff81085618&gt;] ? process_one_work+0x228/0x4d0
 [&lt;ffffffff81085c1d&gt;] worker_thread+0x35d/0x460
 [&lt;ffffffff810858c0&gt;] ? process_one_work+0x4d0/0x4d0
 [&lt;ffffffff810858c0&gt;] ? process_one_work+0x4d0/0x4d0
 [&lt;ffffffff8108a885&gt;] kthread+0xf5/0x100
 [&lt;ffffffff810990e5&gt;] ? local_clock+0x25/0x30
 [&lt;ffffffff8108a790&gt;] ? __init_kthread_worker+0x70/0x70
 [&lt;ffffffff815ce2ac&gt;] ret_from_fork+0x7c/0xb0
 [&lt;ffffffff8108a790&gt;] ? __init_kthread_work

Signed-off-by: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ext4: remove metadata reservation checks</title>
<updated>2014-07-15T10:02:38Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2014-07-15T10:02:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=71d4f7d032149b935a26eb3ff85c6c837f3714e1'/>
<id>urn:sha1:71d4f7d032149b935a26eb3ff85c6c837f3714e1</id>
<content type='text'>
Commit 27dd43854227b ("ext4: introduce reserved space") reserves 2% of
the file system space to make sure metadata allocations will always
succeed.  Given that, tracking the reservation of metadata blocks is
no longer necessary.

Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: decrement free clusters/inodes counters when block group declared bad</title>
<updated>2014-06-26T14:11:53Z</updated>
<author>
<name>Namjae Jeon</name>
</author>
<published>2014-06-26T14:11:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e43bb4e612b402a631bc549ac496f78bc7a79438'/>
<id>urn:sha1:e43bb4e612b402a631bc549ac496f78bc7a79438</id>
<content type='text'>
We should decrement free clusters counter when block bitmap is marked
as corrupt and free inodes counter when the allocation bitmap is
marked as corrupt to avoid misunderstanding due to incorrect available
size in statfs result.  User can get immediately ENOSPC error from
write begin without reaching for the writepages.

Cc: Darrick J. Wong&lt;darrick.wong@oracle.com&gt;
Reported-by: Amit Sahrawat &lt;amit.sahrawat83@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Ashish Sangwan &lt;a.sangwan@samsung.com&gt;
</content>
</entry>
<entry>
<title>ext4: make local functions static</title>
<updated>2014-05-12T14:50:23Z</updated>
<author>
<name>Stephen Hemminger</name>
</author>
<published>2014-05-12T14:50:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c197855ea14175a25003c276824689e8ba318e53'/>
<id>urn:sha1:c197855ea14175a25003c276824689e8ba318e53</id>
<content type='text'>
I have been running make namespacecheck to look for unneeded globals, and
found these in ext4.

Signed-off-by: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: fix block bitmap validation when bigalloc, ^flex_bg</title>
<updated>2014-05-12T14:17:55Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2014-05-12T14:17:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e674e5cbd0942b42a12106ac0be8330f4301bef4'/>
<id>urn:sha1:e674e5cbd0942b42a12106ac0be8330f4301bef4</id>
<content type='text'>
On a bigalloc,^flex_bg filesystem, the ext4_valid_block_bitmap
function fails to convert from blocks to clusters when spot-checking
the validity of the bitmap block that we've just read from disk.  This
causes ext4 to think that the bitmap is garbage, which results in the
block group being taken offline when it's not necessary.  Add in the
necessary EXT4_B2C() calls to perform the conversions.

Signed-off-by: Darrick J. Wong &lt;darrick.wong@oracle.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: fix block bitmap initialization under sparse_super2</title>
<updated>2014-05-12T14:16:06Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2014-05-12T14:16:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1beeef1b5643a16a07a465632a2cf984a4ef2119'/>
<id>urn:sha1:1beeef1b5643a16a07a465632a2cf984a4ef2119</id>
<content type='text'>
The ext4_bg_has_super() function doesn't know about the new rules for
where backup superblocks go on a sparse_super2 filesystem.  Therefore,
block bitmap initialization doesn't know that it shouldn't reserve
space for backups in groups that are never going to contain backups.
The result of this is e2fsck complaining about the block bitmap being
incorrect (fortunately not in a way that results in cross-linked
files), so fix the whole thing.

Signed-off-by: Darrick J. Wong &lt;darrick.wong@oracle.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: fix ext4_count_free_clusters() with EXT4FS_DEBUG and bigalloc enabled</title>
<updated>2014-04-15T03:36:15Z</updated>
<author>
<name>Azat Khuzhin</name>
</author>
<published>2014-04-15T03:36:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=036acea2ceabd19cb5734ae7a9d64c0a5ef90484'/>
<id>urn:sha1:036acea2ceabd19cb5734ae7a9d64c0a5ef90484</id>
<content type='text'>
With bigalloc enabled we must use EXT4_CLUSTERS_PER_GROUP() instead of
EXT4_BLOCKS_PER_GROUP() otherwise we will go beyond the allocated buffer.

$ mount -t ext4 /dev/vde /vde
[   70.573993] EXT4-fs DEBUG (fs/ext4/mballoc.c, 2346): ext4_mb_alloc_groupinfo:
[   70.575174] allocated s_groupinfo array for 1 meta_bg's
[   70.576172] EXT4-fs DEBUG (fs/ext4/super.c, 2092): ext4_check_descriptors:
[   70.576972] Checking group descriptorsBUG: unable to handle kernel paging request at ffff88006ab56000
[   72.463686] IP: [&lt;ffffffff81394eb9&gt;] __bitmap_weight+0x2a/0x7f
[   72.464168] PGD 295e067 PUD 2961067 PMD 7fa8e067 PTE 800000006ab56060
[   72.464738] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
[   72.465139] Modules linked in:
[   72.465402] CPU: 1 PID: 3560 Comm: mount Tainted: G        W    3.14.0-rc2-00069-ge57bce1 #60
[   72.466079] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[   72.466505] task: ffff88007ce6c8a0 ti: ffff88006b7f0000 task.ti: ffff88006b7f0000
[   72.466505] RIP: 0010:[&lt;ffffffff81394eb9&gt;]  [&lt;ffffffff81394eb9&gt;] __bitmap_weight+0x2a/0x7f
[   72.466505] RSP: 0018:ffff88006b7f1c00  EFLAGS: 00010206
[   72.466505] RAX: 0000000000000000 RBX: 000000000000050a RCX: 0000000000000040
[   72.466505] RDX: 0000000000000000 RSI: 0000000000080000 RDI: 0000000000000000
[   72.466505] RBP: ffff88006b7f1c28 R08: 0000000000000002 R09: 0000000000000000
[   72.466505] R10: 000000000000babe R11: 0000000000000400 R12: 0000000000080000
[   72.466505] R13: 0000000000000200 R14: 0000000000002000 R15: ffff88006ab55000
[   72.466505] FS:  00007f43ba1fa840(0000) GS:ffff88007f800000(0000) knlGS:0000000000000000
[   72.466505] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   72.466505] CR2: ffff88006ab56000 CR3: 000000006b7e6000 CR4: 00000000000006e0
[   72.466505] Stack:
[   72.466505]  ffff88006ab65000 0000000000000000 0000000000000000 0000000000010000
[   72.466505]  ffff88006ab6f400 ffff88006b7f1c58 ffffffff81396bb8 0000000000010000
[   72.466505]  0000000000000000 ffff88007b869a90 ffff88006a48a000 ffff88006b7f1c70
[   72.466505] Call Trace:
[   72.466505]  [&lt;ffffffff81396bb8&gt;] memweight+0x5f/0x8a
[   72.466505]  [&lt;ffffffff811c3b19&gt;] ext4_count_free+0x13/0x21
[   72.466505]  [&lt;ffffffff811c396c&gt;] ext4_count_free_clusters+0xdb/0x171
[   72.466505]  [&lt;ffffffff811e3bdd&gt;] ext4_fill_super+0x117c/0x28ef
[   72.466505]  [&lt;ffffffff81391569&gt;] ? vsnprintf+0x1c7/0x3f7
[   72.466505]  [&lt;ffffffff8114d8dc&gt;] mount_bdev+0x145/0x19c
[   72.466505]  [&lt;ffffffff811e2a61&gt;] ? ext4_calculate_overhead+0x2a1/0x2a1
[   72.466505]  [&lt;ffffffff811dab1d&gt;] ext4_mount+0x15/0x17
[   72.466505]  [&lt;ffffffff8114e3aa&gt;] mount_fs+0x67/0x150
[   72.466505]  [&lt;ffffffff811637ea&gt;] vfs_kern_mount+0x64/0xde
[   72.466505]  [&lt;ffffffff81165d19&gt;] do_mount+0x6fe/0x7f5
[   72.466505]  [&lt;ffffffff81126cc8&gt;] ? strndup_user+0x3a/0xd9
[   72.466505]  [&lt;ffffffff8116604b&gt;] SyS_mount+0x85/0xbe
[   72.466505]  [&lt;ffffffff81619e90&gt;] tracesys+0xdd/0xe2
[   72.466505] Code: c3 89 f0 b9 40 00 00 00 55 99 48 89 e5 41 57 f7 f9 41 56 49 89 ff 41 55 45 31 ed 41 54 41 89 f4 53 31 db 41 89 c6 45 39 ee 7e 10 &lt;4b&gt; 8b 3c ef 49 ff c5 e8 bf ff ff ff 01 c3 eb eb 31 c0 45 85 f6
[   72.466505] RIP  [&lt;ffffffff81394eb9&gt;] __bitmap_weight+0x2a/0x7f
[   72.466505]  RSP &lt;ffff88006b7f1c00&gt;
[   72.466505] CR2: ffff88006ab56000
[   72.466505] ---[ end trace 7d051a08ae138573 ]---
Killed

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: don't count free clusters from a corrupt block group</title>
<updated>2013-10-31T15:46:31Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2013-10-31T15:46:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2746f7a17062d3526116f7ae7f91d88b19c2464e'/>
<id>urn:sha1:2746f7a17062d3526116f7ae7f91d88b19c2464e</id>
<content type='text'>
A bg that's been flagged "corrupt" by definition has no free blocks,
so that the allocator won't be tempted to use the damaged bg.
Therefore, we shouldn't count the clusters in the damaged group when
calculating free counts.

Signed-off-by: Darrick J. Wong &lt;darrick.wong@oracle.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
</content>
</entry>
<entry>
<title>ext4: mark group corrupt on group descriptor checksum</title>
<updated>2013-08-28T22:46:56Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2013-08-28T22:46:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bdfb6ff4a255dcebeb09a901250e13a97eff75af'/>
<id>urn:sha1:bdfb6ff4a255dcebeb09a901250e13a97eff75af</id>
<content type='text'>
If the group descriptor fails validation, mark the whole blockgroup
corrupt so that the inode/block allocators skip this group.  The
previous approach takes the risk of writing to a damaged group
descriptor; hopefully it was never the case that the [ib]bitmap fields
pointed to another valid block and got dirtied, since the memset would
fill the page with 1s.

Signed-off-by: Darrick J. Wong &lt;darrick.wong@oracle.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: mark block group as corrupt on block bitmap error</title>
<updated>2013-08-28T21:35:51Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2013-08-28T21:35:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=163a203ddb36c36d4a1c942aececda0cc8d06aa7'/>
<id>urn:sha1:163a203ddb36c36d4a1c942aececda0cc8d06aa7</id>
<content type='text'>
When we notice a block-bitmap corruption (because of device failure or
something else), we should mark this group as corrupt and prevent
further block allocations/deallocations from it. Currently, we end up
generating one error message for every block in the bitmap. This
potentially could make the system unstable as noticed in some
bugs. With this patch, the error will be printed only the first time
and mark the entire block group as corrupted. This prevents future
access allocations/deallocations from it.

Also tested by corrupting the block
bitmap and forcefully introducing the mb_free_blocks error:
(1) create a largefile (2Gb)
$ dd if=/dev/zero of=largefile oflag=direct bs=10485760 count=200
(2) umount filesystem. use dumpe2fs to see which block-bitmaps
are in use by largefile and note their block numbers
(3) use dd to zero-out the used block bitmaps
$ dd if=/dev/zero of=/dev/hdc4 bs=4096 seek=14 count=8 oflag=direct
(4) mount the FS and delete the largefile.
(5) recreate the largefile. verify that the new largefile does not
get any blocks from the groups marked as bad.
Without the patch, we will see mb_free_blocks error for each bit in
each zero'ed out bitmap at (4). With the patch, we only see the error
once per blockgroup:
[  309.706803] EXT4-fs error (device sdb4): ext4_mb_generate_buddy:735: group 15: 32768 clusters in bitmap, 0 in gd. blk grp corrupted.
[  309.720824] EXT4-fs error (device sdb4): ext4_mb_generate_buddy:735: group 14: 32768 clusters in bitmap, 0 in gd. blk grp corrupted.
[  309.732858] EXT4-fs error (device sdb4) in ext4_free_blocks:4802: IO failure
[  309.748321] EXT4-fs error (device sdb4): ext4_mb_generate_buddy:735: group 13: 32768 clusters in bitmap, 0 in gd. blk grp corrupted.
[  309.760331] EXT4-fs error (device sdb4) in ext4_free_blocks:4802: IO failure
[  309.769695] EXT4-fs error (device sdb4): ext4_mb_generate_buddy:735: group 12: 32768 clusters in bitmap, 0 in gd. blk grp corrupted.
[  309.781721] EXT4-fs error (device sdb4) in ext4_free_blocks:4802: IO failure
[  309.798166] EXT4-fs error (device sdb4): ext4_mb_generate_buddy:735: group 11: 32768 clusters in bitmap, 0 in gd. blk grp corrupted.
[  309.810184] EXT4-fs error (device sdb4) in ext4_free_blocks:4802: IO failure
[  309.819532] EXT4-fs error (device sdb4): ext4_mb_generate_buddy:735: group 10: 32768 clusters in bitmap, 0 in gd. blk grp corrupted.

Google-Bug-Id: 7258357

[darrick.wong@oracle.com]
Further modifications (by Darrick) to make more obvious that this corruption
bit applies to blocks only.  Set the corruption flag if the block group bitmap
verification fails.

Original-author: Aditya Kali &lt;adityakali@google.com&gt;
Signed-off-by: Darrick J. Wong &lt;darrick.wong@oracle.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
</feed>
