Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190186
b: refs/heads/master
c: cac36f7
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Mahoney authored and Linus Torvalds committed Apr 24, 2010
1 parent d231f87 commit 49dca2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33eaf788345c0311ab48ae62673c05f59fb09bb3
refs/heads/master: cac36f707119b792b2396aed371d6b5cdc194890
2 changes: 0 additions & 2 deletions trunk/fs/reiserfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ static inline bool is_privroot_deh(struct dentry *dir,
struct reiserfs_de_head *deh)
{
struct dentry *privroot = REISERFS_SB(dir->d_sb)->priv_root;
if (reiserfs_expose_privroot(dir->d_sb))
return 0;
return (dir == dir->d_parent && privroot->d_inode &&
deh->deh_objectid == INODE_PKEY(privroot->d_inode)->k_objectid);
}
Expand Down
17 changes: 4 additions & 13 deletions trunk/fs/reiserfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,21 +973,13 @@ int reiserfs_permission(struct inode *inode, int mask)
return generic_permission(inode, mask, NULL);
}

/* This will catch lookups from the fs root to .reiserfs_priv */
static int
xattr_lookup_poison(struct dentry *dentry, struct qstr *q1, struct qstr *name)
static int xattr_hide_revalidate(struct dentry *dentry, struct nameidata *nd)
{
struct dentry *priv_root = REISERFS_SB(dentry->d_sb)->priv_root;
if (container_of(q1, struct dentry, d_name) == priv_root)
return -ENOENT;
if (q1->len == name->len &&
!memcmp(q1->name, name->name, name->len))
return 0;
return 1;
return -EPERM;
}

static const struct dentry_operations xattr_lookup_poison_ops = {
.d_compare = xattr_lookup_poison,
.d_revalidate = xattr_hide_revalidate,
};

int reiserfs_lookup_privroot(struct super_block *s)
Expand All @@ -1001,8 +993,7 @@ int reiserfs_lookup_privroot(struct super_block *s)
strlen(PRIVROOT_NAME));
if (!IS_ERR(dentry)) {
REISERFS_SB(s)->priv_root = dentry;
if (!reiserfs_expose_privroot(s))
s->s_root->d_op = &xattr_lookup_poison_ops;
dentry->d_op = &xattr_lookup_poison_ops;
if (dentry->d_inode)
dentry->d_inode->i_flags |= S_PRIVATE;
} else
Expand Down

0 comments on commit 49dca2c

Please sign in to comment.