* [PATCH 1/1] Lock both inodes in rpdfs_unlink()
@ 2026-10-19 18:15 Chris Kirby
2026-10-23 17:33 ` Zach Brown
0 siblings, 1 reply; 2+ messages in thread
From: Chris Kirby @ 2026-10-19 18:15 UTC (permalink / raw)
To: rpdfs-devel; +Cc: Chris Kirby
The code was only locking the parent directory inode. We also need to
lock the inode being unlinked using rpdfs_inode_rlock_refresh_many().
Signed-off-by: Chris Kirby <ckirby@versity.com>
---
fs/rpdfs/dir.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/fs/rpdfs/dir.c b/fs/rpdfs/dir.c
index dab183a07325..8a48817699d7 100644
--- a/fs/rpdfs/dir.c
+++ b/fs/rpdfs/dir.c
@@ -436,13 +436,16 @@ static int rpdfs_unlink(struct inode *dir, struct dentry *dentry)
{
struct rpdfs_fs_info *rfi = RPDFS_INODE_FS(dir);
struct inode *inode = d_inode(dentry);
- DECLARE_RPDFS_RLOCK_HOLD(hold);
+ DECLARE_RPDFS_RLOCK_HOLD(dir_hold);
+ DECLARE_RPDFS_RLOCK_HOLD(inode_hold);
struct dent_args da;
int ret;
init_dent_args(&da, dentry, inode);
- ret = rpdfs_inode_rlock_refresh(dir, RPDFS_RLOCK_MODE_EX_WR, &hold);
+ ret = rpdfs_inode_rlock_refresh_many(dir, &dir_hold, inode, &inode_hold,
+ NULL, NULL, NULL, NULL,
+ RPDFS_RLOCK_MODE_EX_WR);
if (ret < 0) {
inode = ERR_PTR(ret);
goto out;
@@ -469,7 +472,8 @@ static int rpdfs_unlink(struct inode *dir, struct dentry *dentry)
ret = 0;
out:
rpdfs_inode_update(rfi, dir);
- rpdfs_rlock_unlock(rfi, &hold);
+ rpdfs_rlock_unlock(rfi, &inode_hold);
+ rpdfs_rlock_unlock(rfi, &dir_hold);
return ret;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] Lock both inodes in rpdfs_unlink()
2026-10-19 18:15 [PATCH 1/1] Lock both inodes in rpdfs_unlink() Chris Kirby
@ 2026-10-23 17:33 ` Zach Brown
0 siblings, 0 replies; 2+ messages in thread
From: Zach Brown @ 2026-10-23 17:33 UTC (permalink / raw)
To: Chris Kirby; +Cc: rpdfs-devel
On Mon, Oct 19, 2026 at 06:15:36PM +0000, Chris Kirby wrote:
> The code was only locking the parent directory inode. We also need to
> lock the inode being unlinked using rpdfs_inode_rlock_refresh_many().
Applied, thanks!
- z
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-23 17:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 18:15 [PATCH 1/1] Lock both inodes in rpdfs_unlink() Chris Kirby
2026-10-23 17:33 ` Zach Brown
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.