From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) (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 E1B76351C09 for ; Thu, 16 Apr 2026 08:39:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.157.23.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776328763; cv=none; b=uhUYtvRMnrrqOx/OEDc+ujQsO7NGO7ScFJ7ytvZYko1T19D90D/RdwlpuLpiumwPUUxwCrYE8FdPHIIx7KBdMgEXGlxW/3e9zJobW1q/10wUzjUFbkIlU8EM1JxcNpFOvfDeQH/xNnVFHjC1M3uCwpsomXdZvU77gP88UUJ1mpM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776328763; c=relaxed/simple; bh=FQ0PVOc1YVqYceryIuSjfWLCzcMiASV6DBS1GlJ93GQ=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=UHs3pGdnYLkCKZxRabC3+OiP/qpvs+U1MxYnkGdd1/rC591sy7EU6vnfup5Zig4n3BjzertmirUmLVg0oLR89Y/T/WFMBARWpt9LAQyGgNyftmH5Hn6ENRKwsnuudEFd1NOqZBAa7V/er+mzeowk3vvatgTMsV6nIhgKVj0A1yI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=paragon-software.com; spf=pass smtp.mailfrom=paragon-software.com; dkim=pass (1024-bit key) header.d=paragon-software.com header.i=@paragon-software.com header.b=nDMdWUy0; arc=none smtp.client-ip=35.157.23.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=paragon-software.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=paragon-software.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=paragon-software.com header.i=@paragon-software.com header.b="nDMdWUy0" Received: from relayfre-01.paragon-software.com (relayfre-01.paragon-software.com [176.12.100.13]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id B0FCC1D42; Thu, 16 Apr 2026 08:39:30 +0000 (UTC) Authentication-Results: relayaws-01.paragon-software.com; dkim=pass (1024-bit key; unprotected) header.d=paragon-software.com header.i=@paragon-software.com header.b=nDMdWUy0; dkim-atps=neutral Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id 202F32182; Thu, 16 Apr 2026 08:39:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1776328760; bh=owulkjfScGtJLen8Q/CPKS8STXYatVeuNFM6i7+ml+Q=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=nDMdWUy0bxu1fepVBkVSKjatqj0mNKVIaEBP7M9I/C6CuLyYjMVVuny+g3kZQ5kJP X6tkwq1Lz08ytMaMvwOSL2/uNSg5t6Cgbf+RQ3/QdORTiXI92wjim8WGXPNwsk4d2Y 2zaGlqmEoiwluNQVuYmYgR9lStm3jxnSPwqo8LvA= Received: from [192.168.95.128] (172.30.20.197) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Thu, 16 Apr 2026 11:39:18 +0300 Message-ID: Date: Thu, 16 Apr 2026 10:39:16 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ntfs3: fix deadlock in ntfs_force_shutdown To: Deepanshu Kartikey CC: , , References: <20260404153213.365836-1-kartikey406@gmail.com> Content-Language: en-US From: Konstantin Komarov In-Reply-To: <20260404153213.365836-1-kartikey406@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: vobn-exch-01.paragon-software.com (172.30.72.13) To vdlg-exch-02.paragon-software.com (172.30.1.105) On 4/4/26 17:32, Deepanshu Kartikey wrote: > ntfs_force_shutdown() calls bdev_freeze() which internally calls > freeze_super(). freeze_super() calls sb_wait_write() which waits > for all active sb_writers holders to finish. > > However active writers (ntfs_compress_write) can be stuck waiting > for ni->file.run_lock while holding the sb_writers read lock > acquired via file_start_write() in the VFS layer. This creates > a deadlock where freeze_super() waits for writers that can never > complete because they are blocked on run_lock contention. > > Fix by removing bdev_freeze/bdev_thaw entirely. The shutdown bit > NTFS_FLAGS_SHUTDOWN_BIT is already checked at entry of all ntfs3 > write paths (file.c, inode.c, namei.c, frecord.c, fsntfs.c, > super.c, xattr.c) and causes them to return errors immediately, > making further writes impossible without risking a deadlock. > > Reported-by: syzbot+5f6ca38579a76e303c1c@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=5f6ca38579a76e303c1c > Tested-by: syzbot+5f6ca38579a76e303c1c@syzkaller.appspotmail.com > Fixes: ae91dfe38966 ("fs/ntfs3: implement NTFS3_IOC_SHUTDOWN ioctl") > Signed-off-by: Deepanshu Kartikey > --- > fs/ntfs3/file.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c > index 7eecf1e01f74..cbbc7d81875f 100644 > --- a/fs/ntfs3/file.c > +++ b/fs/ntfs3/file.c > @@ -118,18 +118,12 @@ static int ntfs_ioctl_set_volume_label(struct ntfs_sb_info *sbi, u8 __user *buf) > */ > static int ntfs_force_shutdown(struct super_block *sb, u32 flags) > { > - int err; > struct ntfs_sb_info *sbi = sb->s_fs_info; > > if (unlikely(ntfs3_forced_shutdown(sb))) > return 0; > > - /* No additional options yet (flags). */ > - err = bdev_freeze(sb->s_bdev); > - if (err) > - return err; > set_bit(NTFS_FLAGS_SHUTDOWN_BIT, &sbi->flags); > - bdev_thaw(sb->s_bdev); > return 0; > } > Hello, I missed this before, but internal testing shows that this patch causes several failures. I will not include it in the pull request for now. I am looking into the root cause and will reply with details once I have them. If the fix turns out to be straightforward, I will send an updated patch as soon as possible. Regards, Konstantin