From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E83A132A3E5; Sat, 12 Sep 2026 14:13:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789222438; cv=none; b=rYyVkrPWXzVBsXF8j8PXoD0oNO3M3LvSzjlTjG35MLgPgZi4hOWmdmZa2BX7pXqwQwy3Hg1o7aHwAwciXHE4KjBqqm/KzkUb+1qCvzuzhgI8MmWWZM0ni9OyKODEIPVslvEmoyP/LSj63fjgAwHmMRNeb/g+Y8rlBSFJUg1oKHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789222438; c=relaxed/simple; bh=Y4o5ipopqWJLInC3NgZkhHsfMGIv+qTLrp2LU6mwvyI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UmCo5Aw43e/Q3PFgNRpLbNCn0eef7m+ty7zGlXz93CPHnN5o617jpu2uqsd5o+A6IzT5Yr2ArBCGTNLQUpf+pUjMD9Ipbh2gFsuUEZYhyDD1XOea5e/i4B1WsRs+PfGEtMFUpBS4umUJM8HOGH2jd7lHB+b1GdBny8nMUq6czrM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kGBTZBow; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kGBTZBow" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CDED1F000FF; Sat, 12 Sep 2026 14:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789222436; bh=9u2I0v7dGoPB6CDyz4Fir5qKWt4rVMnZR6VPDj3iOD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kGBTZBow1UJr9igvSkYfhrkyQTORQnE6gDf3jve8hVWeOZeaKopBdRAiRsHgmGo+c hM0Oq/JEeC925AybFFc+WUeDFyLrP9cLlojZkwgjdAcOidfXbKXc/BcKN75imsXWKd kF0tVw2oun+nAEA6O9fAJkyBE1E37BPhCdrdHQcY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Namjae Jeon , Steve French , Sasha Levin Subject: [PATCH 6.6 0544/1424] ksmbd: fix WARNING "do not call blocking ops when !TASK_RUNNING" Date: Sat, 12 Sep 2026 08:49:36 +0200 Message-ID: <20260912065619.485232876@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Namjae Jeon [ Upstream commit 1df0d4c616138784e033ad337961b6e1a6bcd999 ] wait_event_timeout() will set the state of the current task to TASK_UNINTERRUPTIBLE, before doing the condition check. This means that ksmbd_durable_scavenger_alive() will try to acquire the mutex while already in a sleeping state. The scheduler warns us by giving the following warning: do not call blocking ops when !TASK_RUNNING; state=2 set at [<0000000061515a6f>] prepare_to_wait_event+0x9f/0x6c0 WARNING: CPU: 2 PID: 4147 at kernel/sched/core.c:10099 __might_sleep+0x12f/0x160 mutex lock is not needed in ksmbd_durable_scavenger_alive(). Signed-off-by: Namjae Jeon Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/smb/server/vfs_cache.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/smb/server/vfs_cache.c b/fs/smb/server/vfs_cache.c index 12db854e4c519..2864ea08d75a6 100644 --- a/fs/smb/server/vfs_cache.c +++ b/fs/smb/server/vfs_cache.c @@ -971,12 +971,8 @@ static bool tree_conn_fd_check(struct ksmbd_tree_connect *tcon, static bool ksmbd_durable_scavenger_alive(void) { - mutex_lock(&durable_scavenger_lock); - if (!durable_scavenger_running) { - mutex_unlock(&durable_scavenger_lock); + if (!durable_scavenger_running) return false; - } - mutex_unlock(&durable_scavenger_lock); if (kthread_should_stop()) return false; @@ -1085,9 +1081,7 @@ static int ksmbd_durable_scavenger(void *dummy) break; } - mutex_lock(&durable_scavenger_lock); durable_scavenger_running = false; - mutex_unlock(&durable_scavenger_lock); module_put(THIS_MODULE); -- 2.53.0