diff options
author | Theodore Ts'o <tytso@mit.edu> | 2014-10-05 22:56:00 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-10-05 22:56:00 -0400 |
commit | f4bb2981024fc91b23b4d09a8817c415396dbabb (patch) | |
tree | 7645d062e8808ab71b81b542c388e47d8b78b35f /fs/ext4/namei.c | |
parent | e2bfb088fac03c0f621886a04cffc7faa2b49b1d (diff) |
ext4: add ext4_iget_normal() which is to be used for dir tree lookups
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 <sami.liedes@iki.fi>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r-- | fs/ext4/namei.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index a2a9d40522d2..7037ecf0fc23 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -1417,7 +1417,7 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsi | |||
1417 | dentry); | 1417 | dentry); |
1418 | return ERR_PTR(-EIO); | 1418 | return ERR_PTR(-EIO); |
1419 | } | 1419 | } |
1420 | inode = ext4_iget(dir->i_sb, ino); | 1420 | inode = ext4_iget_normal(dir->i_sb, ino); |
1421 | if (inode == ERR_PTR(-ESTALE)) { | 1421 | if (inode == ERR_PTR(-ESTALE)) { |
1422 | EXT4_ERROR_INODE(dir, | 1422 | EXT4_ERROR_INODE(dir, |
1423 | "deleted inode referenced: %u", | 1423 | "deleted inode referenced: %u", |
@@ -1450,7 +1450,7 @@ struct dentry *ext4_get_parent(struct dentry *child) | |||
1450 | return ERR_PTR(-EIO); | 1450 | return ERR_PTR(-EIO); |
1451 | } | 1451 | } |
1452 | 1452 | ||
1453 | return d_obtain_alias(ext4_iget(child->d_inode->i_sb, ino)); | 1453 | return d_obtain_alias(ext4_iget_normal(child->d_inode->i_sb, ino)); |
1454 | } | 1454 | } |
1455 | 1455 | ||
1456 | /* | 1456 | /* |