From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 A869037DAD6 for ; Thu, 21 May 2026 13:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779368425; cv=none; b=bDWmgNzUdSpQLLglZqB2rhnOc26AhSWDpMpMSuJNGPwh4N6PVAt+xzmDigyyBP3pUmhy46QJxKMTn/YoXuEX12Fuh8SpbNMxL/BPxIv6eYym2XJciNaz1oMT0DlzVMGPhFA9CgnUOzKidNrDXgG8zjWhZwQUiHB+BhpYOSJKhw4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779368425; c=relaxed/simple; bh=LhD75nHZEknel0Wtc1hUU+oGbQEDH64D5mahZjdeVZk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G3v8iBKC6NoURSMcx6XD0q6XnLRgyV4E0K8o/VQllqGM2D2BUIxdeG0D1Onbjgm3yd/XNBMBxvH3Jwy+hAhv5SH/VkwKRwbDNGwXvG3QqDg2zThUlT60Hf8uhqE6RgGRxJ42FtFWWBVcicujAskD0L1/3XMkJYEjLVXNTEoqB4Q= 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=oxozSqQn; arc=none smtp.client-ip=209.85.216.42 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="oxozSqQn" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-365deee00c3so555416a91.1 for ; Thu, 21 May 2026 06:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779368423; x=1779973223; 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=jysZaOsjDwX5f/p00tbuFB9BJf63zxKVw0gwxzAqdmk=; b=oxozSqQn/xaOisMzPFUVLhV+6saSCo7xO1ZHCcvDAgWT09NU1//aMPuFGAe3bKpXSR ikpRz2NGqTITeZeyTn/Z1bnc0q9erFeeo6XpEYV3XTdlMdUY5ZYNNcZ99NMGQKYMiDdP hWEdlHbkTMz7MWZumZDYXIYamgqUGE42TUc7lDhq1OLu8CtfI3E7R5kDkIMf6DhDKKqD OyysgoKoJA79yYBGswgmdRM2Yntx9uSZO50B9bl7/FwmIfyjmeTHp3wsmQGsusOfF3e2 i4d4GzI735RQMIF/kCD/XEa8HCZL3LwXzDIs8T1kRiJiSWl8781QHOI+DfHiuK3nTOQD 4vKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779368423; x=1779973223; 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=jysZaOsjDwX5f/p00tbuFB9BJf63zxKVw0gwxzAqdmk=; b=Ir2OIWl8QK+mLLekor+JgsJ1c5IBpqgCI1HQoRKeEumPyHKRiyDLFT4kavoiJpcNnM 8nF+/99TK3GQGHlW+TFhDhLBA4Al9AChmZ2ThenlpHyA24BpJ2tRkqsY6Joe5VesQfG5 dQ/2fCN61wl/sFn4pi1FO+2ec4L/WI5USBg1Ee/0uqOVU4mt9H42TWtugKWFipE/Msed h7QyGEkTD5BCHR9mV0NMZ7hJOC83DhF9OzuQrsDQGeHiqOq9+wYHV4ke/0gawLPzRoJj SzB4kX9Z9eKLOBhZujwqgjT7e/dmM3P9nHrbTjq2FmG7Daio+Mil7pqBY+FkCI1Hsy9h cuxg== X-Forwarded-Encrypted: i=1; AFNElJ9NR1HaP3H0iPxRzlvSDGULQz9wyPCXjWN0e1wX+nz1o8rZahf6aQoejikwpKddDidI53VewBhS7WoDMSs=@vger.kernel.org X-Gm-Message-State: AOJu0YyDpU5bNmPDnwj/pTCBtUKi+ZjK4cCEU133/dYW2fTNzyrsGuYu CEVm/JkkH6QTnus5RuaUpTg6Ux/dJO3IlhtKvjZ7/C2QVGWD0uQ5pa7WT+K2nA== X-Gm-Gg: Acq92OGlVul9rb7G8Um3B/9cqDjpMvLICTI1Lfo47mC0IIHpOvvB+BzjOTyWCn9mIxH Q0oQOOkQ48ByFDsPj/oG/E9diVrW8eCFQ4lt443cfE9zMcBIKYXyTmk27PE66FklkPrxNR4ulGg odBQvvuCFdgyfMVmnKfzo27cCyBWvJCi8e75nHeENZJ5sqPFfWQJL8b0vpOzzAB+1aRGNcc5UIF 482WUFzVMaRQccJGpdDwpwRKenG29XO0CcsIsKW3cczLmSPgy2JkmtxUO51OIe7CVsA42tpuXka vALR6DqVgnGhsgkDYuyjLrFLoJZp60E4ATMRtZDvIket4EYD7awgmeBbTvlQ/1xQR4OSlZGrdjq GbqVxalH386FUcit1kGP1MpNNrlhS3XzJ3zsnZI3BgMhWoapw0l5ho+53fAsc4T4d+HL2ZTEbtW KZezzFZhcCTNMiqwW9xiNGmlU/yDI= X-Received: by 2002:a05:6a20:2448:b0:39e:df5e:edc2 with SMTP id adf61e73a8af0-3b308702bc7mr1814981637.2.1779368422903; Thu, 21 May 2026 06:00:22 -0700 (PDT) Received: from ser8.. ([221.156.231.192]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c851993d8a7sm284340a12.27.2026.05.21.06.00.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 06:00:22 -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 v3 0/3] ntfs: fix mount failure cleanup and free-count setup Date: Thu, 21 May 2026 22:00:14 +0900 Message-ID: <20260521130017.713848-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 v3 is based on current mainline at 8bc67e4db64a. The patches modify fs/ntfs/super.c in the Linux kernel tree. 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: - Built fs/ntfs/super.o and fs/ntfs/ntfs.ko with gcc 13.3.0. - 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 v2: - Changed patch 2's on-stack file_ra_state initializer from the empty initializer to { 0 } to avoid build failures with stricter compilers. - Re-tested patch 2 alone and patches 1-2 on a clean mainline tree. 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