diff options
-rw-r--r-- | fs/reiserfs/dir.c | 24 | ||||
-rw-r--r-- | fs/reiserfs/namei.c | 17 | ||||
-rw-r--r-- | fs/reiserfs/xattr.c | 2 | ||||
-rw-r--r-- | include/linux/reiserfs_fs_sb.h | 1 |
4 files changed, 16 insertions, 28 deletions
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c index 67a80d7e59e2..45ee3d357c70 100644 --- a/fs/reiserfs/dir.c +++ b/fs/reiserfs/dir.c | |||
@@ -41,6 +41,18 @@ static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, | |||
41 | 41 | ||
42 | #define store_ih(where,what) copy_item_head (where, what) | 42 | #define store_ih(where,what) copy_item_head (where, what) |
43 | 43 | ||
44 | static inline bool is_privroot_deh(struct dentry *dir, | ||
45 | struct reiserfs_de_head *deh) | ||
46 | { | ||
47 | int ret = 0; | ||
48 | #ifdef CONFIG_REISERFS_FS_XATTR | ||
49 | struct dentry *privroot = REISERFS_SB(dir->d_sb)->priv_root; | ||
50 | ret = (dir == dir->d_parent && privroot->d_inode && | ||
51 | deh->deh_objectid == INODE_PKEY(privroot->d_inode)->k_objectid); | ||
52 | #endif | ||
53 | return ret; | ||
54 | } | ||
55 | |||
44 | int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent, | 56 | int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent, |
45 | filldir_t filldir, loff_t *pos) | 57 | filldir_t filldir, loff_t *pos) |
46 | { | 58 | { |
@@ -138,18 +150,8 @@ int reiserfs_readdir_dentry(struct dentry *dentry, void *dirent, | |||
138 | } | 150 | } |
139 | 151 | ||
140 | /* Ignore the .reiserfs_priv entry */ | 152 | /* Ignore the .reiserfs_priv entry */ |
141 | if (reiserfs_xattrs(inode->i_sb) && | 153 | if (is_privroot_deh(dentry, deh)) |
142 | !old_format_only(inode->i_sb) && | ||
143 | dentry == inode->i_sb->s_root && | ||
144 | REISERFS_SB(inode->i_sb)->priv_root && | ||
145 | REISERFS_SB(inode->i_sb)->priv_root->d_inode | ||
146 | && deh_objectid(deh) == | ||
147 | le32_to_cpu(INODE_PKEY | ||
148 | (REISERFS_SB(inode->i_sb)-> | ||
149 | priv_root->d_inode)-> | ||
150 | k_objectid)) { | ||
151 | continue; | 154 | continue; |
152 | } | ||
153 | 155 | ||
154 | d_off = deh_offset(deh); | 156 | d_off = deh_offset(deh); |
155 | *pos = d_off; | 157 | *pos = d_off; |
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index efd4d720718e..271579128634 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c | |||
@@ -338,21 +338,8 @@ static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry, | |||
338 | &path_to_entry, &de); | 338 | &path_to_entry, &de); |
339 | pathrelse(&path_to_entry); | 339 | pathrelse(&path_to_entry); |
340 | if (retval == NAME_FOUND) { | 340 | if (retval == NAME_FOUND) { |
341 | /* Hide the .reiserfs_priv directory */ | 341 | inode = reiserfs_iget(dir->i_sb, |
342 | if (reiserfs_xattrs(dir->i_sb) && | 342 | (struct cpu_key *)&(de.de_dir_id)); |
343 | !old_format_only(dir->i_sb) && | ||
344 | REISERFS_SB(dir->i_sb)->priv_root && | ||
345 | REISERFS_SB(dir->i_sb)->priv_root->d_inode && | ||
346 | de.de_objectid == | ||
347 | le32_to_cpu(INODE_PKEY | ||
348 | (REISERFS_SB(dir->i_sb)->priv_root->d_inode)-> | ||
349 | k_objectid)) { | ||
350 | reiserfs_write_unlock(dir->i_sb); | ||
351 | return ERR_PTR(-EACCES); | ||
352 | } | ||
353 | |||
354 | inode = | ||
355 | reiserfs_iget(dir->i_sb, (struct cpu_key *)&(de.de_dir_id)); | ||
356 | if (!inode || IS_ERR(inode)) { | 343 | if (!inode || IS_ERR(inode)) { |
357 | reiserfs_write_unlock(dir->i_sb); | 344 | reiserfs_write_unlock(dir->i_sb); |
358 | return ERR_PTR(-EACCES); | 345 | return ERR_PTR(-EACCES); |
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index c77984473db9..2237e10c7c7c 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -841,7 +841,7 @@ ssize_t reiserfs_listxattr(struct dentry * dentry, char *buffer, size_t size) | |||
841 | if (!dentry->d_inode) | 841 | if (!dentry->d_inode) |
842 | return -EINVAL; | 842 | return -EINVAL; |
843 | 843 | ||
844 | if (!reiserfs_xattrs(dentry->d_sb) || | 844 | if (!dentry->d_sb->s_xattr || |
845 | get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1) | 845 | get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1) |
846 | return -EOPNOTSUPP; | 846 | return -EOPNOTSUPP; |
847 | 847 | ||
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 8651640868a1..6473650c28f1 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h | |||
@@ -488,7 +488,6 @@ enum reiserfs_mount_options { | |||
488 | #define reiserfs_data_log(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_LOG)) | 488 | #define reiserfs_data_log(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_LOG)) |
489 | #define reiserfs_data_ordered(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_ORDERED)) | 489 | #define reiserfs_data_ordered(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_ORDERED)) |
490 | #define reiserfs_data_writeback(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_WRITEBACK)) | 490 | #define reiserfs_data_writeback(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_DATA_WRITEBACK)) |
491 | #define reiserfs_xattrs(s) ((s)->s_xattr != NULL) | ||
492 | #define reiserfs_xattrs_user(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_XATTRS_USER)) | 491 | #define reiserfs_xattrs_user(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_XATTRS_USER)) |
493 | #define reiserfs_posixacl(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_POSIXACL)) | 492 | #define reiserfs_posixacl(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_POSIXACL)) |
494 | #define reiserfs_xattrs_optional(s) (reiserfs_xattrs_user(s) || reiserfs_posixacl(s)) | 493 | #define reiserfs_xattrs_optional(s) (reiserfs_xattrs_user(s) || reiserfs_posixacl(s)) |