<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/ext4/ialloc.c, branch v3.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-03-12T03:39:59Z</updated>
<entry>
<title>ext4: use atomic64_t for the per-flexbg free_clusters count</title>
<updated>2013-03-12T03:39:59Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2013-03-12T03:39:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=90ba983f6889e65a3b506b30dc606aa9d1d46cd2'/>
<id>urn:sha1:90ba983f6889e65a3b506b30dc606aa9d1d46cd2</id>
<content type='text'>
A user who was using a 8TB+ file system and with a very large flexbg
size (&gt; 65536) could cause the atomic_t used in the struct flex_groups
to overflow.  This was detected by PaX security patchset:

http://forums.grsecurity.net/viewtopic.php?f=3&amp;t=3289&amp;p=12551#p12551

This bug was introduced in commit 9f24e4208f7e, so it's been around
since 2.6.30.  :-(

Fix this by using an atomic64_t for struct orlav_stats's
free_clusters.

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: use KERN_WARNING for warning messages</title>
<updated>2013-02-14T20:11:41Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2013-02-14T20:11:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8de5c325b4ee7d5b23b95edd28b81c9a2a9f427f'/>
<id>urn:sha1:8de5c325b4ee7d5b23b95edd28b81c9a2a9f427f</id>
<content type='text'>
Some messages printed related to a WARN_ON(1) were printed using
KERN_NOTICE.  Use KERN_WARNING or ext4_warning() instead so that
context related to the WARN_ON() is printed at the same printk warning
level (and log files, etc.)

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: start handle at the last possible moment when creating inodes</title>
<updated>2013-02-09T21:27:09Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2013-02-09T21:27:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1139575a927010390c6b38e4215a6d741b056074'/>
<id>urn:sha1:1139575a927010390c6b38e4215a6d741b056074</id>
<content type='text'>
In ext4_{create,mknod,mkdir,symlink}(), don't start the journal handle
until the inode has been succesfully allocated.  In order to do this,
we need to start the handle in the ext4_new_inode().  So create a new
variant of this function, ext4_new_inode_start_handle(), so the handle
can be created at the last possible minute, before we need to modify
the inode allocation bitmap block.

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: pass context information to jbd2__journal_start()</title>
<updated>2013-02-09T02:59:22Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2013-02-09T02:59:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9924a92a8c217576bd2a2b1bbbb854462f1a00ae'/>
<id>urn:sha1:9924a92a8c217576bd2a2b1bbbb854462f1a00ae</id>
<content type='text'>
So we can better understand what bits of ext4 are responsible for
long-running jbd2 handles, use jbd2__journal_start() so we can pass
context information for logging purposes.

The recommended way for finding the longer-running handles is:

   T=/sys/kernel/debug/tracing
   EVENT=$T/events/jbd2/jbd2_handle_stats
   echo "interval &gt; 5" &gt; $EVENT/filter
   echo 1 &gt; $EVENT/enable

   ./run-my-fs-benchmark

   cat $T/trace &gt; /tmp/problem-handles

This will list handles that were active for longer than 20ms.  Having
longer-running handles is bad, because a commit started at the wrong
time could stall for those 20+ milliseconds, which could delay an
fsync() or an O_SYNC operation.  Here is an example line from the
trace file describing a handle which lived on for 311 jiffies, or over
1.2 seconds:

postmark-2917  [000] ....   196.435786: jbd2_handle_stats: dev 254,32 
   tid 570 type 2 line_no 2541 interval 311 sync 0 requested_blocks 1
   dirtied_blocks 0

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: enable ext4 inline support</title>
<updated>2012-12-10T19:06:03Z</updated>
<author>
<name>Tao Ma</name>
<email>boyu.mt@taobao.com</email>
</author>
<published>2012-12-10T19:06:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f08225d176a5736363beea653b9b3fb9400c1255'/>
<id>urn:sha1:f08225d176a5736363beea653b9b3fb9400c1255</id>
<content type='text'>
Signed-off-by: Tao Ma &lt;boyu.mt@taobao.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: fix possible use after free with metadata csum</title>
<updated>2012-11-30T02:21:22Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-11-30T02:21:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aeb1e5d69a5be592e86a926be73efb38c55af404'/>
<id>urn:sha1:aeb1e5d69a5be592e86a926be73efb38c55af404</id>
<content type='text'>
Commit fa77dcfafeaa introduces block bitmap checksum calculation into
ext4_new_inode() in the case that block group was uninitialized.
However we brelse() the bitmap buffer before we attempt to checksum it
so we have no guarantee that the buffer is still there.

Fix this by releasing the buffer after the possible checksum
computation.

Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Acked-by: Darrick J. Wong &lt;darrick.wong@oracle.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: fix unjournaled inode bitmap modification</title>
<updated>2012-10-29T02:24:57Z</updated>
<author>
<name>Eric Sandeen</name>
<email>sandeen@redhat.com</email>
</author>
<published>2012-10-29T02:24:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ffb5387e85d528fb6d0d924abfa3fbf0fc484071'/>
<id>urn:sha1:ffb5387e85d528fb6d0d924abfa3fbf0fc484071</id>
<content type='text'>
commit 119c0d4460b001e44b41dcf73dc6ee794b98bd31 changed
ext4_new_inode() such that the inode bitmap was being modified
outside a transaction, which could lead to corruption, and was
discovered when journal_checksum found a bad checksum in the
journal during log replay.

Nix ran into this when using the journal_async_commit mount
option, which enables journal checksumming.  The ensuing
journal replay failures due to the bad checksums led to
filesystem corruption reported as the now infamous
"Apparent serious progressive ext4 data corruption bug"

[ Changed by tytso to only call ext4_journal_get_write_access() only
  when we're fairly certain that we're going to allocate the inode. ]

I've tested this by mounting with journal_checksum and
running fsstress then dropping power; I've also tested by
hacking DM to create snapshots w/o first quiescing, which
allows me to test journal replay repeatedly w/o actually
power-cycling the box.  Without the patch I hit a journal
checksum error every time.  With this fix it survives
many iterations.

Reported-by: Nix &lt;nix@esperi.org.uk&gt;
Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org

</content>
</entry>
<entry>
<title>ext4: Checksum the block bitmap properly with bigalloc enabled</title>
<updated>2012-10-22T04:34:32Z</updated>
<author>
<name>Tao Ma</name>
<email>boyu.mt@taobao.com</email>
</author>
<published>2012-10-22T04:34:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=79f1ba49569e5aec919b653c55b03274c2331701'/>
<id>urn:sha1:79f1ba49569e5aec919b653c55b03274c2331701</id>
<content type='text'>
In mke2fs, we only checksum the whole bitmap block and it is right.
While in the kernel, we use EXT4_BLOCKS_PER_GROUP to indicate the
size of the checksumed bitmap which is wrong when we enable bigalloc.
The right size should be EXT4_CLUSTERS_PER_GROUP and this patch fixes
it.

Also as every caller of ext4_block_bitmap_csum_set and
ext4_block_bitmap_csum_verify pass in EXT4_BLOCKS_PER_GROUP(sb)/8,
we'd better removes this parameter and sets it in the function itself.

Signed-off-by: Tao Ma &lt;boyu.mt@taobao.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: check free inode count before allocating an inode</title>
<updated>2012-09-24T03:16:03Z</updated>
<author>
<name>Yongqiang Yang</name>
<email>xiaoqiangnk@gmail.com</email>
</author>
<published>2012-09-24T03:16:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f2a09af645b762f8230e7eba7fee3b6f7e6e96e7'/>
<id>urn:sha1:f2a09af645b762f8230e7eba7fee3b6f7e6e96e7</id>
<content type='text'>
Recently, I ecountered some corrupted filesystems in which some
groups' free inode counts were 65535, it seemed that free inode
count was overflow.  This patch teaches ext4 to check free inode
count before allocaing an inode.

Signed-off-by: Yongqiang Yang &lt;xiaoqiangnk@gmail.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: remove useless marking of superblock dirty</title>
<updated>2012-07-23T00:29:31Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2012-07-23T00:29:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=97a7406880f61d7f89d613cf72e87682420e66b0'/>
<id>urn:sha1:97a7406880f61d7f89d613cf72e87682420e66b0</id>
<content type='text'>
Commit a0375156 properly notes that superblock doesn't need to be marked
as dirty when only number of free inodes / blocks / number of directories
changes since that is recomputed on each mount anyway. However that comment
leaves some unnecessary markings as dirty in place. Remove these.

Artem: tested using xfstests for both journalled and non-journalled ext4.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Tested-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
</feed>
