summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-05-18 02:45:29 (GMT)
committerPawel Osmialowski <p.osmialowsk@mcdsrvbld02.digital.local>2015-03-27 13:37:38 (GMT)
commit487e9abba021fe27b825d71d9cfbba61925df215 (patch)
tree5707d25a2e87e0e0b9effe139f7e7fbca6102a76
parentcfd3e72ec303f116837703d38eceaf0e1c98c77f (diff)
downloadlinux-3.10-487e9abba021fe27b825d71d9cfbba61925df215.zip
linux-3.10-487e9abba021fe27b825d71d9cfbba61925df215.tar.gz
linux-3.10-487e9abba021fe27b825d71d9cfbba61925df215.tar.bz2
reiserfs: is_privroot_deh() needs only directory inode, actually
... and that - only to get the superblock. Privroot is a directory and we don't allow hardlinks to those... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/reiserfs/dir.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c
index cafa5bf..9e8c07e 100644
--- a/fs/reiserfs/dir.c
+++ b/fs/reiserfs/dir.c
@@ -50,11 +50,10 @@ static int reiserfs_dir_fsync(struct file *filp, loff_t start, loff_t end,
#define store_ih(where,what) copy_item_head (where, what)
-static inline bool is_privroot_deh(struct dentry *dir,
- struct reiserfs_de_head *deh)
+static inline bool is_privroot_deh(struct inode *dir, struct reiserfs_de_head *deh)
{
- struct dentry *privroot = REISERFS_SB(dir->d_sb)->priv_root;
- return (dir == dir->d_parent && privroot->d_inode &&
+ struct dentry *privroot = REISERFS_SB(dir->i_sb)->priv_root;
+ return (privroot->d_inode &&
deh->deh_objectid == INODE_PKEY(privroot->d_inode)->k_objectid);
}
@@ -154,7 +153,7 @@ int reiserfs_readdir_dentry(struct dentry *dentry, struct dir_context *ctx)
}
/* Ignore the .reiserfs_priv entry */
- if (is_privroot_deh(dentry, deh))
+ if (is_privroot_deh(inode, deh))
continue;
ctx->pos = deh_offset(deh);