* [PATCH 08/22] gfs2: d_obtain_alias(ERR_PTR(...)) will do the right thing
[not found] <20231220051348.GY1674809@ZenIV>
@ 2023-12-20 5:21 ` Al Viro
2023-12-20 5:31 ` [PATCH 20/22] gfs2: use is_subdir() Al Viro
1 sibling, 0 replies; 2+ messages in thread
From: Al Viro @ 2023-12-20 5:21 UTC (permalink / raw)
To: linux-fsdevel; +Cc: gfs2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
fs/gfs2/export.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/gfs2/export.c b/fs/gfs2/export.c
index cf40895233f5..3334c394ce9c 100644
--- a/fs/gfs2/export.c
+++ b/fs/gfs2/export.c
@@ -138,8 +138,6 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb,
return ERR_PTR(-ESTALE);
inode = gfs2_lookup_by_inum(sdp, inum->no_addr, inum->no_formal_ino,
GFS2_BLKST_DINODE);
- if (IS_ERR(inode))
- return ERR_CAST(inode);
return d_obtain_alias(inode);
}
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 20/22] gfs2: use is_subdir()
[not found] <20231220051348.GY1674809@ZenIV>
2023-12-20 5:21 ` [PATCH 08/22] gfs2: d_obtain_alias(ERR_PTR(...)) will do the right thing Al Viro
@ 2023-12-20 5:31 ` Al Viro
1 sibling, 0 replies; 2+ messages in thread
From: Al Viro @ 2023-12-20 5:31 UTC (permalink / raw)
To: linux-fsdevel; +Cc: gfs2
... instead of reimplementing it with misguiding name (is_ancestor(x, y)
would normally imply "x is an ancestor of y", not the other way round).
With races, while we are at it...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
fs/gfs2/super.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index d21c04a22d73..b5c75c8a8d62 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1065,16 +1065,6 @@ static int gfs2_drop_inode(struct inode *inode)
return generic_drop_inode(inode);
}
-static int is_ancestor(const struct dentry *d1, const struct dentry *d2)
-{
- do {
- if (d1 == d2)
- return 1;
- d1 = d1->d_parent;
- } while (!IS_ROOT(d1));
- return 0;
-}
-
/**
* gfs2_show_options - Show mount options for /proc/mounts
* @s: seq_file structure
@@ -1096,7 +1086,7 @@ static int gfs2_show_options(struct seq_file *s, struct dentry *root)
statfs_slow = sdp->sd_tune.gt_statfs_slow;
spin_unlock(&sdp->sd_tune.gt_spin);
- if (is_ancestor(root, sdp->sd_master_dir))
+ if (is_subdir(root, sdp->sd_master_dir))
seq_puts(s, ",meta");
if (args->ar_lockproto[0])
seq_show_option(s, "lockproto", args->ar_lockproto);
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-20 5:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20231220051348.GY1674809@ZenIV>
2023-12-20 5:21 ` [PATCH 08/22] gfs2: d_obtain_alias(ERR_PTR(...)) will do the right thing Al Viro
2023-12-20 5:31 ` [PATCH 20/22] gfs2: use is_subdir() Al Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox