From: Al Viro Date: Sat, 18 May 2013 02:45:29 +0000 (-0400) Subject: reiserfs: is_privroot_deh() needs only directory inode, actually X-Git-Tag: v3.11-rc1~166^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99ce4169a9ff1c6ecdcccf01638eb6d76e5d84d1;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 --- diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c index cba7016..df25fff 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); } @@ -153,7 +152,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);