From f8b0abe8d62069e88b2da75f63c5d5fe0519e56b Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 9 Apr 2026 14:41:57 -0700 Subject: [PATCH] Fix double unlock in scoutfs_setattr data_wait error path When scoutfs_setattr truncates a file with offline extents, it unlocks the inode lock before calling scoutfs_data_wait to wait for the data to be staged. If data_wait returns any error, the code jumps to 'goto out' which calls scoutfs_unlock again, thus double-unlocking the lock. Signed-off-by: Auke Kok --- kmod/src/inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kmod/src/inode.c b/kmod/src/inode.c index a4d118f1..96376dc0 100644 --- a/kmod/src/inode.c +++ b/kmod/src/inode.c @@ -549,6 +549,7 @@ retry: goto out; if (scoutfs_data_wait_found(&dw)) { scoutfs_unlock(sb, lock, SCOUTFS_LOCK_WRITE); + lock = NULL; /* XXX callee locks instead? */ inode_unlock(inode);