From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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 C84AA421F12 for ; Mon, 11 May 2026 16:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778515594; cv=none; b=m5BL8VAH06Y2eKDKTDMFkuGDsBmIoWgm+WCTPgoZlfnvv2Fst+tWTdFG1K8WuNS5KClTL1H4EwiKj5cHEwjLmBMYBXhwLG2BUVgEG1BeS1NPKvzEz8DGnK/YRPXD7IfOs6cv7lzjzd9FQ6Mztj8c1QM6t8ZbNxJHiFjY2DYjGsg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778515594; c=relaxed/simple; bh=BFtepgnp/PlnOpupuJFh72epy+jS/rjS4N7q0VTscnw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=lsiqEVPDMCnt1Xo7HQVS4h59WwiA3Xp8HWIJCnCPIRjMHeQS1nDDb5UWSaF//Q6zbGxKqTh/q5rPTv4O3KlR81M4Bt6yCLf8+SFKgDWX5q39w3VIxhB5jtJq18KUaPLmXRy4wFAQM7cS8rhMGrfpUXCooU2DLxm2WtpZcaVixT0= 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=HxfxT8D2; arc=none smtp.client-ip=209.85.215.173 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="HxfxT8D2" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-c70e3eb3af1so173322a12.2 for ; Mon, 11 May 2026 09:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778515591; x=1779120391; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9TqYJrlh6iNG/bwZqH/TNG2Kiv2CgDG6sq7EqRVuJDM=; b=HxfxT8D2DZ/HHTsXka4G6Gv60Te4g4iAd3zATkYTWkoaI1enxB4xo3cJ+5qEHZDTDW gU5GTm19O6RKNEl8WYvahigRGG9GkH6wNLOyRaQ/DDOFhszluIT3B8H/A5e67o4Ox8J2 pQ/B9Kbbk58sjw/HdFlqKGhEFHWkzUAKLGArWBSvpuVi0WIxylb6vEl9JeHMR+Jq9E0G lJ2v5FK11QHhe6jqAdTiwQWYRPm+YooaaBolT/RfltpE2+rnAtcEhqTWxK2HXzbgiaE3 0/Rm5EBrsImo7JVPcyTm8f37tuYpVTXmF/vAhsXDiFi9CSVqzhBUJxwmh3hQnSFk/WGg 0obA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778515591; x=1779120391; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9TqYJrlh6iNG/bwZqH/TNG2Kiv2CgDG6sq7EqRVuJDM=; b=MaHWjm7Wkz8WerwXDEyBLnUjYq1SMRJCh3680QCdnxuW8sYH9K3Kko3pgY4V8fo/6U 8zXAEXejhVLqUYQi8t4IKHi42QAgyZVdWNdnetuD4uzcmnnEdomTa9SJcxnrzZrbqxj8 7xX6ZVDT6q697WM0odiV/wqPvNxfcyAKytH6w8cNngIumOQbZCI9apVXO69y/HoH3YJ5 JN5/1Wd9HaYw0AqKdt2DqDLuHF6qXVVL0YTkF828UmGnzT4ngM0jWwv9QPLiGnOPHTUQ tMnIOU1q/FLY/DmKzAlyzMDt9htFF4yf6otlHVM0Njy/OcsdDbaXAH0OZXHDfFMtNcOv l0XA== X-Forwarded-Encrypted: i=1; AFNElJ/qPSPzGfb+E+/6m84Avfsh8bbUade6Flkzw3G652SOjCBiRDbYXUBF43763p0m57OEE6x3CJnvtDSb46s=@vger.kernel.org X-Gm-Message-State: AOJu0YxS0QOi8kEoH3izuyahA05pd037ApJj5LrtMh9KvsrLgjrJPGCw m7N/h5evWoZEHNY3i1F2wAjL9Yzo5xYtBXUA7rUGm08CO+YEfdLwbWa7hAizDA== X-Gm-Gg: Acq92OHz5ZSuTD858BBZbPV6ZYEJDHKZ4GqxPF6dKRxGaIqg9phTB0+x4DJ0qloWvF1 yZQKmbVBQAkpImkzD5rENWrMPpdp04o+AGA2H07r8ttlO6eEruXQUYB+6/8gwSqW0qYJtzzJlls G86LKMykLXgXz8EenQZaAcLV5gMyAPzyrkmbwoPJGQtvb24hea3OznmP3q9jT4HDGdXMpADQIaI lnzOU9zSGeniv2wbLTISozccLubz3XXy3ZjmX+8Z1LSri3oK5nnWgMlK7nwaRD0j/6eSfAfwISO H9yZhN6GLzS+6+nwe8NtIEA9dZq8br0kt5lOWx4neSulNw5eewmh+g2H8uKGSun4TjZTx2EhgLk 2nezPn9ofutngh5EUytIpi7Rbmy5fMHarTMyck6+FAFR/+WQQOguW2jMTn8Ym6bycozns8tpz/i mKAgSxZlbq5q9jfSO/5XN7WrqL/y0= X-Received: by 2002:a17:902:da84:b0:2b2:eb6b:72f2 with SMTP id d9443c01a7336-2ba7f5444a2mr140161645ad.7.1778515590676; Mon, 11 May 2026 09:06:30 -0700 (PDT) Received: from ser8.. ([221.156.231.192]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2baf1e35ebesm112447045ad.43.2026.05.11.09.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 09:06:30 -0700 (PDT) From: DaeMyung Kang To: linkinjeon@kernel.org, hyc.lee@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, DaeMyung Kang Subject: [PATCH 0/3] ntfs: fix quota out-of-date marking Date: Tue, 12 May 2026 01:06:22 +0900 Message-ID: <20260511160626.1268612-1-charsyam@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This series fixes NTFS quota out-of-date marking in fs/ntfs. The driver already has quota compatibility code: it loads FILE_Extend/$Quota, opens the $Q index, and has ntfs_mark_quotas_out_of_date() to set QUOTA_FLAG_OUT_OF_DATE so Windows can rescan quota usage. The failures were not an intentional quota block; the code could not reach and update the $Quota/$Q defaults entry correctly. Patch 1 fixes ntfs_index_lookup() so callers looking up view indexes get the index entry value instead of the key. Directory $I30 callers keep the existing key-return behavior. The patch uses the index root type, not the collation rule, to choose between $FILE_NAME keys and view-index values. It also validates the returned value bounds without truncating the minimum offset, excludes the child VCN tail from INDEX_ENTRY_NODE value ranges, and clears the returned context pointers before returning an invalid view-index entry error. The matched-entry data exposure and validation are moved into a small helper, ntfs_index_lookup_set_data(), so the done label stays flat and the bounds check has a single return. Patch 2 fixes ntfs_mark_quotas_out_of_date() to look up $Quota/$Q by the $Q index name, not $I30. Patch 3 calls ntfs_mark_quotas_out_of_date() during initial read-write mount as well as the existing read-only to read-write remount path. The init sequence is wrapped in a small helper, ntfs_init_quota_for_mount(), which captures each call result in a local variable, derives the failure reason, and gates the read-only downgrade on policy in one place — keeping ntfs_load_system_files() flat. QEMU/virtme testing: - The original remount-rw reproducer failed with: "Lookup of quota defaults entry failed." - After changing only the quota index name, the same path exposed the second bug and failed with: "Quota defaults entry size is invalid. Run chkdsk." - With this series applied: - read-only mount followed by remount,rw succeeds - with the $Quota/$Q defaults flags prepared as 0x00000011, remount,rw persists 0x00000211 - direct rw mount with the same prepared image also persists 0x00000211 DaeMyung Kang (3): ntfs: return view index entry data from lookup ntfs: use $Q when marking quotas out of date ntfs: mark quotas out of date on initial rw mount fs/ntfs/index.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- fs/ntfs/index.h | 3 +- fs/ntfs/quota.c | 3 +- fs/ntfs/super.c | 46 ++++++++++++++++++++++++++-------- 4 files changed, 110 insertions(+), 17 deletions(-) -- 2.43.0