<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/ext2, branch v2.6.30.7</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/ext2?h=v2.6.30.7</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/ext2?h=v2.6.30.7'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2009-04-27T14:49:52Z</updated>
<entry>
<title>ext2: missing unlock in ext2_quota_write()</title>
<updated>2009-04-27T14:49:52Z</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2009-04-09T16:07:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a069e9cee1dba2f847839d325f46ce6976ed1b76'/>
<id>urn:sha1:a069e9cee1dba2f847839d325f46ce6976ed1b76</id>
<content type='text'>
The inode-&gt;i_mutex should be unlocked.

Found by smatch (http://repo.or.cz/w/smatch.git).  Compile tested.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>ext2: fix data corruption for racing writes</title>
<updated>2009-04-13T22:04:33Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2009-04-13T21:40:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=316cb4ef3eb2ad6e35e15cc56d39c6cda58c093a'/>
<id>urn:sha1:316cb4ef3eb2ad6e35e15cc56d39c6cda58c093a</id>
<content type='text'>
If two writers allocating blocks to file race with each other (e.g.
because writepages races with ordinary write or two writepages race with
each other), ext2_getblock() can be called on the same inode in parallel.
Before we are going to allocate new blocks, we have to recheck the block
chain we have obtained so far without holding truncate_mutex.  Otherwise
we could overwrite the indirect block pointer set by the other writer
leading to data loss.

The below test program by Ying is able to reproduce the data loss with ext2
on in BRD in a few minutes if the machine is under memory pressure:

long kMemSize  = 50 &lt;&lt; 20;
int kPageSize = 4096;

int main(int argc, char **argv) {
	int status;
	int count = 0;
	int i;
	char *fname = "/mnt/test.mmap";
	char *mem;
	unlink(fname);
	int fd = open(fname, O_CREAT | O_EXCL | O_RDWR, 0600);
	status = ftruncate(fd, kMemSize);
	mem = mmap(0, kMemSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
	// Fill the memory with 1s.
	memset(mem, 1, kMemSize);
	sleep(2);
	for (i = 0; i &lt; kMemSize; i++) {
		int byte_good = mem[i] != 0;
		if (!byte_good &amp;&amp; ((i % kPageSize) == 0)) {
			//printf("%d ", i / kPageSize);
			count++;
		}
	}
	munmap(mem, kMemSize);
	close(fd);
	unlink(fname);

	if (count &gt; 0) {
		printf("Running %d bad page\n", count);
		return 1;
	}
	return 0;
}

Cc: Ying Han &lt;yinghan@google.com&gt;
Cc: Nick Piggin &lt;nickpiggin@yahoo.com.au&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Cc: Mingming Cao &lt;cmm@us.ibm.com&gt;
Cc: &lt;linux-ext4@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>New helper - current_umask()</title>
<updated>2009-04-01T03:00:26Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2009-03-29T23:08:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ce3b0f8d5c2203301fc87f3aaaed73e5819e2a48'/>
<id>urn:sha1:ce3b0f8d5c2203301fc87f3aaaed73e5819e2a48</id>
<content type='text'>
current-&gt;fs-&gt;umask is what most of fs_struct users are doing.
Put that into a helper function.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ext2: Zero our b_size in ext2_quota_read()</title>
<updated>2009-03-26T01:18:38Z</updated>
<author>
<name>Manish Katiyar</name>
<email>mkatiyar@gmail.com</email>
</author>
<published>2009-02-12T20:57:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c16831b4cc9b0805adf8ca3001752a7ec10a17bf'/>
<id>urn:sha1:c16831b4cc9b0805adf8ca3001752a7ec10a17bf</id>
<content type='text'>
ext2_quota_read() doesn't initialize tmp_bh.b_size before calling
ext2_get_block() where we access it. Since it is a local variable it
might contain some garbage. Make sure it is filled with reasonable
value before passing.

Signed-off-by: Manish Katiyar &lt;mkatiyar@gmail.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>ext2: Use lowercase names of quota functions</title>
<updated>2009-03-26T01:18:36Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2009-01-26T15:52:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6f90bee5062a8af24d8aa5c47182d15aa28a0f17'/>
<id>urn:sha1:6f90bee5062a8af24d8aa5c47182d15aa28a0f17</id>
<content type='text'>
Use lowercase names of quota functions instead of old uppercase ones.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
CC: linux-ext4@vger.kernel.org
</content>
</entry>
<entry>
<title>ext2/xip: refuse to change xip flag during remount with busy inodes</title>
<updated>2009-02-11T22:25:36Z</updated>
<author>
<name>Carsten Otte</name>
<email>cotte@de.ibm.com</email>
</author>
<published>2009-02-11T21:04:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0e4a9b59282914fe057ab17027f55123964bc2e2'/>
<id>urn:sha1:0e4a9b59282914fe057ab17027f55123964bc2e2</id>
<content type='text'>
For a reason that I was unable to understand in three months of debugging,
mount ext2 -o remount stopped working properly when remounting from
regular operation to xip, or the other way around.  According to a git
bisect search, the problem was introduced with the VM_MIXEDMAP/PTE_SPECIAL
rework in the vm:

commit 70688e4dd1647f0ceb502bbd5964fa344c5eb411
Author: Nick Piggin &lt;npiggin@suse.de&gt;
Date:   Mon Apr 28 02:13:02 2008 -0700

    xip: support non-struct page backed memory

In the failing scenario, the filesystem is mounted read only via root=
kernel parameter on s390x.  During remount (in rc.sysinit), the inodes of
the bash binary and its libraries are busy and cannot be invalidated (the
bash which is running rc.sysinit resides on subject filesystem).
Afterwards, another bash process (running ifup-eth) recurses into a
subshell, runs dup_mm (via fork).  Some of the mappings in this bash
process were created from inodes that could not be invalidated during
remount.

Both parent and child process crash some time later due to inconsistencies
in their address spaces.  The issue seems to be timing sensitive, various
attempts to recreate it have failed.

This patch refuses to change the xip flag during remount in case some
inodes cannot be invalidated.  This patch keeps users from running into
that issue.

[akpm@linux-foundation.org: cleanup]
Signed-off-by: Carsten Otte &lt;cotte@de.ibm.com&gt;
Cc: Nick Piggin &lt;npiggin@suse.de&gt;
Cc: Jared Hulbert &lt;jaredeh@gmail.com&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ext2: also update the inode on disk when dir is IS_DIRSYNC</title>
<updated>2009-01-16T00:39:42Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2009-01-15T21:51:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6b7021ef7e1a703c7092daeceda063951b22b4f6'/>
<id>urn:sha1:6b7021ef7e1a703c7092daeceda063951b22b4f6</id>
<content type='text'>
We used to just write changed page for IS_DIRSYNC inodes.  But we also
have to update the directory inode itself just for the case that we've
allocated a new block and changed i_size.

[akpm@linux-foundation.org: still sync the data page]
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Tested-by: Pavel Machek &lt;pavel@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ext2: tighten restrictions on inode flags</title>
<updated>2009-01-08T16:31:00Z</updated>
<author>
<name>Duane Griffin</name>
<email>duaneg@dghda.com</email>
</author>
<published>2009-01-08T02:07:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ef8b646183868b2d042fa6cde0eef2a31263ff85'/>
<id>urn:sha1:ef8b646183868b2d042fa6cde0eef2a31263ff85</id>
<content type='text'>
At the moment there are few restrictions on which flags may be set on
which inodes.  Specifically DIRSYNC may only be set on directories and
IMMUTABLE and APPEND may not be set on links.  Tighten that to disallow
TOPDIR being set on non-directories and only NODUMP and NOATIME to be set
on non-regular file, non-directories.

Introduces a flags masking function which masks flags based on mode and
use it during inode creation and when flags are set via the ioctl to
facilitate future consistency.

Signed-off-by: Duane Griffin &lt;duaneg@dghda.com&gt;
Acked-by: Andreas Dilger &lt;adilger@sun.com&gt;
Cc: &lt;linux-ext4@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ext2: don't inherit inappropriate inode flags from parent</title>
<updated>2009-01-08T16:31:00Z</updated>
<author>
<name>Duane Griffin</name>
<email>duaneg@dghda.com</email>
</author>
<published>2009-01-08T02:07:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0e090f1e05a563cc9acdda442767176bf1616001'/>
<id>urn:sha1:0e090f1e05a563cc9acdda442767176bf1616001</id>
<content type='text'>
At present BTREE/INDEX is the only flag that new ext2 inodes do NOT
inherit from their parent.  In addition prevent the flags DIRTY, ECOMPR,
INDEX, IMAGIC and TOPDIR from being inherited.  List inheritable flags
explicitly to prevent future flags from accidentally being inherited.

This fixes the TOPDIR flag inheritance bug reported at
http://bugzilla.kernel.org/show_bug.cgi?id=9866.

Signed-off-by: Duane Griffin &lt;duaneg@dghda.com&gt;
Acked-by: Andreas Dilger &lt;adilger@sun.com&gt;
Cc: &lt;linux-ext4@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ext2: allocate -&gt;s_blockgroup_lock separately</title>
<updated>2009-01-08T16:31:00Z</updated>
<author>
<name>Pekka J Enberg</name>
<email>penberg@cs.helsinki.fi</email>
</author>
<published>2009-01-08T02:07:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=18a82eb9f980b5e02cea651e4ecda26265d98933'/>
<id>urn:sha1:18a82eb9f980b5e02cea651e4ecda26265d98933</id>
<content type='text'>
As spotted by kmemtrace, struct ext2_sb_info is 17024 bytes on 64-bit
which makes it a very bad fit for SLAB allocators.  The culprit of the
wasted memory is -&gt;s_blockgroup_lock which can be as big as 16 KB when
NR_CPUS &gt;= 32.

To fix that, allocate -&gt;s_blockgroup_lock, which fits nicely in a order 2
page in the worst case, separately.  This shinks down struct ext2_sb_info
enough to fit a 1 KB slab cache so now we allocate 16 KB + 1 KB instead of
32 KB saving 15 KB of memory.

Acked-by: Andreas Dilger &lt;adilger@sun.com&gt;
Signed-off-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Cc: &lt;linux-ext4@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
