From: Jeff Mahoney <jeffm@suse.com>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: reiserfs-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
stefanr@s5r6.in-berlin.de
Subject: [patch 4/4] reiserfs: allow exposing privroot w/ xattrs enabled
Date: Sun, 10 May 2009 16:05:39 -0400 [thread overview]
Message-ID: <20090510200650.028382548@suse.com> (raw)
In-Reply-To: 20090510200535.893737918@suse.com
[-- Attachment #1: reiserfs-expose-privroot --]
[-- Type: text/plain, Size: 2936 bytes --]
This patch adds an -oexpose_privroot option to allow access to the privroot.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
fs/reiserfs/dir.c | 10 ++++------
fs/reiserfs/super.c | 1 +
fs/reiserfs/xattr.c | 3 ++-
include/linux/reiserfs_fs_sb.h | 2 ++
4 files changed, 9 insertions(+), 7 deletions(-)
--- a/fs/reiserfs/dir.c
+++ b/fs/reiserfs/dir.c
@@ -44,13 +44,11 @@ static int reiserfs_dir_fsync(struct fil
static inline bool is_privroot_deh(struct dentry *dir,
struct reiserfs_de_head *deh)
{
- int ret = 0;
-#ifdef CONFIG_REISERFS_FS_XATTR
struct dentry *privroot = REISERFS_SB(dir->d_sb)->priv_root;
- ret = (dir == dir->d_parent && privroot->d_inode &&
- deh->deh_objectid == INODE_PKEY(privroot->d_inode)->k_objectid);
-#endif
- return ret;
+ 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);
}
int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent,
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -898,6 +898,7 @@ static int reiserfs_parse_options(struct
{"conv",.setmask = 1 << REISERFS_CONVERT},
{"attrs",.setmask = 1 << REISERFS_ATTRS},
{"noattrs",.clrmask = 1 << REISERFS_ATTRS},
+ {"expose_privroot", .setmask = 1 << REISERFS_EXPOSE_PRIVROOT},
#ifdef CONFIG_REISERFS_FS_XATTR
{"user_xattr",.setmask = 1 << REISERFS_XATTRS_USER},
{"nouser_xattr",.clrmask = 1 << REISERFS_XATTRS_USER},
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -982,7 +982,8 @@ int reiserfs_lookup_privroot(struct supe
strlen(PRIVROOT_NAME));
if (!IS_ERR(dentry)) {
REISERFS_SB(s)->priv_root = dentry;
- s->s_root->d_op = &xattr_lookup_poison_ops;
+ if (!reiserfs_expose_privroot(s))
+ s->s_root->d_op = &xattr_lookup_poison_ops;
if (dentry->d_inode)
dentry->d_inode->i_flags |= S_PRIVATE;
} else
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -453,6 +453,7 @@ enum reiserfs_mount_options {
REISERFS_ATTRS,
REISERFS_XATTRS_USER,
REISERFS_POSIXACL,
+ REISERFS_EXPOSE_PRIVROOT,
REISERFS_BARRIER_NONE,
REISERFS_BARRIER_FLUSH,
@@ -490,6 +491,7 @@ enum reiserfs_mount_options {
#define reiserfs_data_writeback(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_WRITEBACK))
#define reiserfs_xattrs_user(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_XATTRS_USER))
#define reiserfs_posixacl(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_POSIXACL))
+#define reiserfs_expose_privroot(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_EXPOSE_PRIVROOT))
#define reiserfs_xattrs_optional(s) (reiserfs_xattrs_user(s) || reiserfs_posixacl(s))
#define reiserfs_barrier_none(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_BARRIER_NONE))
#define reiserfs_barrier_flush(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_BARRIER_FLUSH))
next prev parent reply other threads:[~2009-05-10 20:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-10 20:05 [patch 0/4] reiserfs xattr fixups Jeff Mahoney
2009-05-10 20:05 ` [patch 1/4] reiserfs: clean up ifdefs Jeff Mahoney
2009-05-10 20:05 ` [patch 2/4] [PATCH] reiserfs: deal with NULL xattr root w/ xattrs disabled Jeff Mahoney
2009-05-10 20:05 ` [patch 3/4] reiserfs: fixup perms when xattrs are disabled Jeff Mahoney
2009-05-10 21:35 ` Al Viro
2009-05-10 23:28 ` Jeff Mahoney
2009-05-10 20:05 ` Jeff Mahoney [this message]
2009-05-10 21:34 ` [patch 0/4] reiserfs xattr fixups Stefan Richter
-- strict thread matches above, loose matches on Subject: below --
2009-05-17 5:02 [patch 0/4] Reiserfs fixes Jeff Mahoney
2009-05-17 5:02 ` [patch 4/4] reiserfs: allow exposing privroot w/ xattrs enabled Jeff Mahoney
2009-05-17 17:10 ` Linus Torvalds
2009-05-18 17:28 ` Linus Torvalds
2009-05-18 17:35 ` Jeff Mahoney
2009-05-18 17:42 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090510200650.028382548@suse.com \
--to=jeffm@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=reiserfs-devel@vger.kernel.org \
--cc=stefanr@s5r6.in-berlin.de \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.