From b342e7560261ce5061450b7db89b75aa2b491d07 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 11 Oct 2014 19:49:21 -0400 Subject: [PATCH] Update patches with signed-off-by and review comments --- disallow-metadata-inodes-in-ext4_iget | 23 ++++++++++------------- dont-truncate-or-orphan-boot-inode | 1 + timestamps | 6 +++--- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/disallow-metadata-inodes-in-ext4_iget b/disallow-metadata-inodes-in-ext4_iget index 9976e1bd..77c57ffb 100644 --- a/disallow-metadata-inodes-in-ext4_iget +++ b/disallow-metadata-inodes-in-ext4_iget @@ -15,11 +15,11 @@ Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org --- - fs/ext4/ext4.h | 1 + - fs/ext4/inode.c | 10 ++++++++++ - fs/ext4/namei.c | 4 ++-- - fs/ext4/super.c | 2 +- - 4 files changed, 14 insertions(+), 3 deletions(-) + fs/ext4/ext4.h | 1 + + fs/ext4/inode.c | 7 +++++++ + fs/ext4/namei.c | 4 ++-- + fs/ext4/super.c | 2 +- + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 1eb5b7b..012e89b 100644 @@ -34,21 +34,18 @@ index 1eb5b7b..012e89b 100644 extern int ext4_setattr(struct dentry *, struct iattr *); extern int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry, diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c -index 59983b2..437622c 100644 +index 59983b2..e204d8a 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c -@@ -4104,6 +4104,16 @@ bad_inode: +@@ -4104,6 +4104,13 @@ bad_inode: return ERR_PTR(ret); } +struct inode *ext4_iget_normal(struct super_block *sb, unsigned long ino) +{ -+ struct inode *ret_inode = ext4_iget(sb, ino); -+ -+ if (ret_inode && !IS_ERR(ret_inode) && -+ ino < EXT4_FIRST_INO(sb) && ino != EXT4_ROOT_INO) -+ make_bad_inode(ret_inode); -+ return ret_inode; ++ if (ino < EXT4_FIRST_INO(sb) && ino != EXT4_ROOT_INO) ++ return ERR_PTR(-EIO); ++ return ext4_iget(sb, ino); +} + static int ext4_inode_blocks_set(handle_t *handle, diff --git a/dont-truncate-or-orphan-boot-inode b/dont-truncate-or-orphan-boot-inode index 82452432..88f7eea9 100644 --- a/dont-truncate-or-orphan-boot-inode +++ b/dont-truncate-or-orphan-boot-inode @@ -17,6 +17,7 @@ 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 +Reviewed-by: Jan Kara Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org --- diff --git a/timestamps b/timestamps index decb8bea..0179558e 100755 --- a/timestamps +++ b/timestamps @@ -98,8 +98,8 @@ touch -d @1412216777 get-rid-of-code-duplication touch -d @1412218629 optimize-block-allocations-on-grow-indepth touch -d @1412354843 grab-missed-write_count-for-EXT4_IOC_SWAP_BOOT touch -d @1412354903 stable-boundary -touch -d @1412562182 series touch -d @1412563627 dont-truncate-or-orphan-boot-inode touch -d @1412564160 disallow-metadata-inodes-in-ext4_iget -touch -d @1412564160 status -touch -d @1412608263 timestamps +touch -d @1412608320 series +touch -d @1413070621 status +touch -d @1413071355 timestamps -- 2.11.4.GIT