<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/ext4/namei.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: Replace open coded mdata csum feature to helper function</title>
<updated>2014-11-14T18:10:30Z</updated>
<author>
<name>Dmitry Monakhov</name>
</author>
<published>2014-10-13T07:36:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2b3b37b28739a07d9daf8a5e8d2415cbc4df1022'/>
<id>urn:sha1:2b3b37b28739a07d9daf8a5e8d2415cbc4df1022</id>
<content type='text'>
commit 9aa5d32ba269bec0e7eaba2697a986a7b0bc8528 upstream.

Besides the fact that this replacement improves code readability
it also protects from errors caused direct EXT4_S(sb)-&gt;s_es manipulation
which may result attempt to use uninitialized  csum machinery.

#Testcase_BEGIN
IMG=/dev/ram0
MNT=/mnt
mkfs.ext4 $IMG
mount $IMG $MNT
#Enable feature directly on disk, on mounted fs
tune2fs -O metadata_csum  $IMG
# Provoke metadata update, likey result in OOPS
touch $MNT/test
umount $MNT
#Testcase_END

# Replacement script
@@
expression E;
@@
- EXT4_HAS_RO_COMPAT_FEATURE(E, EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)
+ ext4_has_metadata_csum(E)

https://bugzilla.kernel.org/show_bug.cgi?id=82201

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: don't orphan or truncate the boot loader inode</title>
<updated>2014-11-14T18:10:30Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2014-10-06T02:47:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5be56bf0f1040b9b05cc3fc1ed0e9e4816385c74'/>
<id>urn:sha1:5be56bf0f1040b9b05cc3fc1ed0e9e4816385c74</id>
<content type='text'>
commit e2bfb088fac03c0f621886a04cffc7faa2b49b1d upstream.

The boot loader inode (inode #5) should never be visible in the
directory hierarchy, but it's possible if the file system is corrupted
that there will be a directory entry that points at inode #5.  In
order to avoid accidentally trashing it, when such a directory inode
is opened, the inode will be marked as a bad inode, so that it's not
possible to modify (or read) the inode from userspace.

Unfortunately, when we unlink this (invalid/illegal) directory entry,
we will put the bad inode on the ophan list, and then when try to
unlink the directory, we don't actually remove the bad inode from the
orphan list before freeing in-memory inode structure.  This means the
in-memory orphan list is corrupted, leading to a kernel oops.

In addition, avoid truncating a bad inode in ext4_destroy_inode(),
since truncating the boot loader inode is not a smart thing to do.

Reported-by: Sami Liedes &lt;sami.liedes@iki.fi&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&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: add ext4_iget_normal() which is to be used for dir tree lookups</title>
<updated>2014-11-14T18:10:30Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2014-10-06T02:56:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=207c775cb6c23f2ae887a058f0563344773f77ae'/>
<id>urn:sha1:207c775cb6c23f2ae887a058f0563344773f77ae</id>
<content type='text'>
commit f4bb2981024fc91b23b4d09a8817c415396dbabb upstream.

If there is a corrupted file system which has directory entries that
point at reserved, metadata inodes, prohibit them from being used by
treating them the same way we treat Boot Loader inodes --- that is,
mark them to be bad inodes.  This prohibits them from being opened,
deleted, or modified via chmod, chown, utimes, etc.

In particular, this prevents a corrupted file system which has a
directory entry which points at the journal inode from being deleted
and its blocks released, after which point Much Hilarity Ensues.

Reported-by: Sami Liedes &lt;sami.liedes@iki.fi&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: avoid trying to kfree an ERR_PTR pointer</title>
<updated>2014-09-03T13:37:30Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2014-09-03T13:33:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a9cfcd63e8d206ce4235c355d857c4fbdf0f4587'/>
<id>urn:sha1:a9cfcd63e8d206ce4235c355d857c4fbdf0f4587</id>
<content type='text'>
Thanks to Dan Carpenter for extending smatch to find bugs like this.
(This was found using a development version of smatch.)

Fixes: 36de928641ee48b2078d3fe9514242aaa2f92013
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: fix same-dir rename when inline data directory overflows</title>
<updated>2014-08-29T02:22:29Z</updated>
<author>
<name>Darrick J. Wong</name>
</author>
<published>2014-08-27T22:40:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d80d448c6c5bdd32605b78a60fe8081d82d4da0f'/>
<id>urn:sha1:d80d448c6c5bdd32605b78a60fe8081d82d4da0f</id>
<content type='text'>
When performing a same-directory rename, it's possible that adding or
setting the new directory entry will cause the directory to overflow
the inline data area, which causes the directory to be converted to an
extent-based directory.  Under this circumstance it is necessary to
re-read the directory when deleting the old dirent because the "old
directory" context still points to i_block in the inode table, which
is now an extent tree root!  The delete fails with an FS error, and
the subsequent fsck complains about incorrect link counts and
hardlinked directories.

Test case (originally found with flat_dir_test in the metadata_csum
test program):

# mkfs.ext4 -O inline_data /dev/sda
# mount /dev/sda /mnt
# mkdir /mnt/x
# touch /mnt/x/changelog.gz /mnt/x/copyright /mnt/x/README.Debian
# sync
# for i in /mnt/x/*; do mv $i $i.longer; done
# ls -la /mnt/x/
total 0
-rw-r--r-- 1 root root 0 Aug 25 12:03 changelog.gz.longer
-rw-r--r-- 1 root root 0 Aug 25 12:03 copyright
-rw-r--r-- 1 root root 0 Aug 25 12:03 copyright.longer
-rw-r--r-- 1 root root 0 Aug 25 12:03 README.Debian.longer

(Hey!  Why are there four files now??)

Signed-off-by: Darrick J. Wong &lt;darrick.wong@oracle.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: propagate errors up to ext4_find_entry()'s callers</title>
<updated>2014-08-23T21:47:19Z</updated>
<author>
<name>Theodore Ts'o</name>
</author>
<published>2014-08-23T21:47:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=36de928641ee48b2078d3fe9514242aaa2f92013'/>
<id>urn:sha1:36de928641ee48b2078d3fe9514242aaa2f92013</id>
<content type='text'>
If we run into some kind of error, such as ENOMEM, while calling
ext4_getblk() or ext4_dx_find_entry(), we need to make sure this error
gets propagated up to ext4_find_entry() and then to its callers.  This
way, transient errors such as ENOMEM can get propagated to the VFS.
This is important so that the system calls return the appropriate
error, and also so that in the case of ext4_lookup(), we return an
error instead of a NULL inode, since that will result in a negative
dentry cache entry that will stick around long past the OOM condition
which caused a transient ENOMEM error.

Google-Bug-Id: #17142205

Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>fs: call rename2 if exists</title>
<updated>2014-08-07T18:40:09Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2014-07-23T13:15:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7177a9c4b509eb357cc450256bc3cf39f1a1e639'/>
<id>urn:sha1:7177a9c4b509eb357cc450256bc3cf39f1a1e639</id>
<content type='text'>
Christoph Hellwig suggests:

1) make vfs_rename call -&gt;rename2 if it exists instead of -&gt;rename
2) switch all filesystems that you're adding NOREPLACE support for to
   use -&gt;rename2
3) see how many -&gt;rename instances we'll have left after a few
   iterations of 2.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ext4: reduce contention on s_orphan_lock</title>
<updated>2014-05-26T15:56:53Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2014-05-26T15:56:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d745a8c20c1f864c10ca78d0f89219633861b7e9'/>
<id>urn:sha1:d745a8c20c1f864c10ca78d0f89219633861b7e9</id>
<content type='text'>
Shuffle code around in ext4_orphan_add() and ext4_orphan_del() so that
we avoid taking global s_orphan_lock in some cases and hold it for
shorter time in other cases.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: use sbi in ext4_orphan_{add|del}()</title>
<updated>2014-05-26T15:39:17Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2014-05-26T15:39:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cd2c080c33fdab4ecf5ad43c88be0d3b646d272b'/>
<id>urn:sha1:cd2c080c33fdab4ecf5ad43c88be0d3b646d272b</id>
<content type='text'>
Use sbi pointer consistently in ext4_orphan_del() instead of opencoding
it sometimes. Also ext4_orphan_add() uses EXT4_SB(sb) often so create
sbi variable for it as well and use it.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: add missing BUFFER_TRACE before ext4_journal_get_write_access</title>
<updated>2014-05-13T02:06:43Z</updated>
<author>
<name>liang xie</name>
</author>
<published>2014-05-13T02:06:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5d60125530b0122f5a0a57481f3064a6250365dd'/>
<id>urn:sha1:5d60125530b0122f5a0a57481f3064a6250365dd</id>
<content type='text'>
Make them more consistently

Signed-off-by: xieliang &lt;xieliang@xiaomi.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
</feed>
