Skip to content

Commit 99ce416

Browse files
author
Al Viro
committed
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>
1 parent 4acf381 commit 99ce416

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎fs/reiserfs/dir.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@ static int reiserfs_dir_fsync(struct file *filp, loff_t start, loff_t end,
5050

5151
#define store_ih(where,what) copy_item_head (where, what)
5252

53-
static inline bool is_privroot_deh(struct dentry *dir,
54-
struct reiserfs_de_head *deh)
53+
static inline bool is_privroot_deh(struct inode *dir, struct reiserfs_de_head *deh)
5554
{
56-
struct dentry *privroot = REISERFS_SB(dir->d_sb)->priv_root;
57-
return (dir == dir->d_parent && privroot->d_inode &&
55+
struct dentry *privroot = REISERFS_SB(dir->i_sb)->priv_root;
56+
return (privroot->d_inode &&
5857
deh->deh_objectid == INODE_PKEY(privroot->d_inode)->k_objectid);
5958
}
6059

@@ -153,7 +152,7 @@ int reiserfs_readdir_dentry(struct dentry *dentry, struct dir_context *ctx)
153152
}
154153

155154
/* Ignore the .reiserfs_priv entry */
156-
if (is_privroot_deh(dentry, deh))
155+
if (is_privroot_deh(inode, deh))
157156
continue;
158157

159158
ctx->pos = deh_offset(deh);

0 commit comments

Comments
 (0)