From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A77537DE87 for ; Thu, 21 May 2026 10:17:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779358678; cv=none; b=BBC1tNvQcvorEyHVD/cOLTXyJfcrtGjByoaagEn/QmRaPD7dAf8vq/3bof86Sx9v92L0CsWJgkMhboOyFHIBMB78r72CyxrgdIf7P1Sllt9yT6hcf4zWhcp6gSqSowH3V7h5IDZnQ1Pgw2uksCmu+5QP/XqHx0/m9Swy3eBBeB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779358678; c=relaxed/simple; bh=Q9VydSV+XdrtmFQ92ahtHUfrgLbJCnGhDjV29GYwgO4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mH1aSimwAHLD5718JTwGTqMsh1mQAcqfGk3NW8rxkjdghHxSJdvTsw1AUDR0SSzthf4OnFC8SkQbU+D2XQK+ousW2YqqlHnrIkYLHodBCJ4PEiK67r+F/um5nkkg/Roz0MdSPbkBVRlWKzN038i/1TOQp5R/zsqqRZIcLk39+j8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WQZ8wrAD; arc=none smtp.client-ip=209.85.215.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WQZ8wrAD" Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-c80192af816so472740a12.2 for ; Thu, 21 May 2026 03:17:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779358676; x=1779963476; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VUq/VZ0EvZ3mOtr2Ff9TemlHUvqeWnmfG6EoGwdn/9g=; b=WQZ8wrADBYH2PKit9RWSUfy9GTKz0VL5ICElcSuilR+90h4nwdZSiII+m3d2v1qsk+ KmmLNz7j1Zl747VTGaqPNTr9s8qB47ihhmkymjG7blf+PfS8bPO4mqG6r7bLpeJaPIf1 64ugZFBqpzMEuUpkWjIrx1hc5500LQRqTSi2jQsTGltvd02BLBAep+XDrvBMly3koxci gDzFQyMDox4kg8AyOSPwBivSFOYOfoDsosU3lVXyJpLFfkV10cEnTt4vfOASmUhRRrHk jo0DLZjywBtq02qFvd9pB9UyOxyKmetuwoDjgoBNMFJKx911TqNa3ImGrD6J9jstHWJR KFkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779358676; x=1779963476; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VUq/VZ0EvZ3mOtr2Ff9TemlHUvqeWnmfG6EoGwdn/9g=; b=R+W9k6lZXdwZk/NM8MQbGitcJDy0Gqwgghw8RnRG3KmkobII7pe/wsFfZ29fivnUH6 LQhnRniX+XfieuDivu90x/fsNPs0ANEobcx/dKmzk8FGHv8TcfX5NQLnqZ7bcWNKALCL aCpb5yYd5mdS1tgIc7bg4nen/cDQROo328oXCZqHoQsOGFxhLv5RIdiEE+7Kxpg3pvaE /nK+jMjhKeJLvmuPEgqZsWHmn/SO7RpgY5/pekpAaDI2HtpwRi7AcquwqBJXefjXD7If L8bsSeG3cojlfJ2hcr0VYdTgPpsUiglsjC06H1vW3/pTnI3oVmQEkGHol21QmlQ5Dl3D 9hcQ== X-Forwarded-Encrypted: i=1; AFNElJ+gnxBxJY20ykpZ/fPTrcj+J4uhVnqpj4x7UMSW0yEOwrNJoHgXm4OGAij/ns2DzvvnVmRgIEaFluHYUss=@vger.kernel.org X-Gm-Message-State: AOJu0YwpDaN/0SOi2+AFHwK4b7LnUgIc0O7ruP83IqC7Oop29g4aKHF2 FYaSBW19TnfQNLPd3M1GedFAJ3qnqEJTPgO0B2TFt3CfQxktU8G4IPYz X-Gm-Gg: Acq92OGGMZcZmyG9h1E75F1fFbTCy3so7aE9TfPD3RTt/OWT2Cx+/VfVdBteiWAFQWO rG4tw5yeRjqLpKot211owPLj81pJCMRqKzPfMvHXi5+mh0AGA9ZU75VEnbML8TtGk4LbcHJlyIC fKmrwlcilkOS1JUudC2JaOlM4Be9ZRsbkxn9gcxEKtaVyrG1dltcZkET7nMUPZgsd+vd/iyPAPg +dwRt102o7T4RCB/MXCttMwDsvjkT4AqvERgL7vg91fCwFthoWTtD06KmsYmCG+ipoOFboniidS 03KFYaM/NFB0o+KO+i94pP7c46tzeKwbSeT6xOVxEWO9NKBmKNhP4twkzQo8EZip1JWk0ZsViJ0 7wgo5026IMEMK0+5pmolmxVMniezTeod/wZabs402B4PViQ+cNm0xQvdS6zIpsddidsm8Y7iJSo h+/4ClPzLvsP9+omZxxShKKYcwrTw= X-Received: by 2002:a05:6a00:3986:b0:82f:99c5:868d with SMTP id d2e1a72fcca58-8414af17c74mr1214787b3a.4.1779358675797; Thu, 21 May 2026 03:17:55 -0700 (PDT) Received: from ser8.. ([221.156.231.192]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84154e1fc86sm1197799b3a.44.2026.05.21.03.17.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 03:17:55 -0700 (PDT) From: DaeMyung Kang To: Namjae Jeon , Hyunchul Lee Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, DaeMyung Kang Subject: [PATCH v2 0/3] ntfs: fix mount failure cleanup and free-count setup Date: Thu, 21 May 2026 19:17:48 +0900 Message-ID: <20260521101751.591345-1-charsyam@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260520170151.4115308-1-charsyam@gmail.com> References: <20260520170151.4115308-1-charsyam@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Namjae, This v2 is ported to the Linux kernel tree and is based on current mainline commit 8bc67e4db64a ("Merge tag 'erofs-for-7.1-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs"). The patches now modify fs/ntfs/super.c rather than the out-of-tree Github layout. The fixes cover mount failure cleanup, a free-cluster precalc allocation failure path that can otherwise leave waiters blocked forever, and the $UpCase default-table alias check. Per review, the free-cluster patch now avoids the temporary file_ra_state heap allocation entirely by using a stack variable for the synchronous bitmap scan. Testing: - For patch 1, I built a DEBUG_KMEMLEAK/DEBUG_FS kernel and injected an ntfs_fill_super() failure immediately after load_system_files(). Before the fix, kmemleak reported the leaked volume label allocated from ntfs_ucstonls(); after the fix, the same failure path produced no kmemleak report. - For patch 2, I used QEMU with a debug injection that forces the initial precalc readahead-state allocation to fail. Before the fix, statfs remained blocked in D state in ntfs_statfs(). This version removes that heap allocation and therefore removes the injected failure point. I also mounted a fresh NTFS image with the stack-backed state and verified statfs reported the same free count as ntfsinfo -m. Changes since v1: - Rebased and regenerated the series for the Linux kernel tree (fs/ntfs/super.c), instead of the Github out-of-tree layout. - Changed patch 2 to declare the temporary file_ra_state on the stack, as suggested by Hyunchul Lee, instead of adding an OOM fallback path. - Zero-initialized patch 2's on-stack file_ra_state because file_ra_state_init() only initializes ra_pages and prev_pos. - Reworded patch 3 to avoid overstating user-visible name comparison effects, and used memcmp() for the exact $UpCase table comparison. DaeMyung Kang (3): ntfs: free volume-wide resources on fill_super failure ntfs: avoid heap allocation for free-cluster readahead state ntfs: only alias volume $UpCase to default on exact match fs/ntfs/super.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) base-commit: 8bc67e4db64aa72732c474b44ea8622062c903f0 -- 2.43.0