From 7b8305aa3fd79cc758ef3db50a38ecd5e75047fc Mon Sep 17 00:00:00 2001 From: propelluo Date: Thu, 14 May 2026 19:20:24 +0800 Subject: [PATCH 1/2] vendor: keep-list: narrow drivers/iommu/*** to iommu/iommufd/*** The original rule '+ /drivers/iommu/***' was wider than the actual vendor baseline. From b3c9864 onwards, drivers/iommu/ has only ever contained the iommufd/ subdirectory (tree hash 1c4e79fb1...); everything else under iommu/ was intentionally stripped. Discovered when upgrading to 6.6.138 produced 91 spurious staged files under drivers/iommu/ (apple-dart.c, intel/, amd/, etc.) that should not be part of the kselftest baseline. After fix, the same 6.6.99 -> 6.6.138 dry-run shows only 3 drivers files transferred (all under iommu/iommufd/), matching the real upstream delta. Replay test still confirms 0 missing files. Co-authored-by: Cursor --- linux-6.6/.vendor-keep.rsync | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux-6.6/.vendor-keep.rsync b/linux-6.6/.vendor-keep.rsync index 4f4fd87..ec9eb97 100644 --- a/linux-6.6/.vendor-keep.rsync +++ b/linux-6.6/.vendor-keep.rsync @@ -46,9 +46,10 @@ P /tst-build.sh + /arch/x86/.gitignore + /arch/x86/include/*** -# ----- drivers/ -- only iommu is retained ----- +# ----- drivers/ -- only iommu/iommufd/ is retained ----- + /drivers/ -+ /drivers/iommu/*** ++ /drivers/iommu/ ++ /drivers/iommu/iommufd/*** # ----- kernel/ -- only bpf is retained ----- + /kernel/ -- Gitee From f84cd7b3f850c3d0fe675a996b3dc5dc8d93ca22 Mon Sep 17 00:00:00 2001 From: propelluo Date: Thu, 14 May 2026 19:40:11 +0800 Subject: [PATCH 2/2] UPGRADE.md: clarify section 6.5 dry-run methods Split section 6.5 into three explicit checks with clear distinct goals, since the original 'use /tmp/preview/ as dst' wording was confusing (readers wondered what /tmp/preview/ was supposed to be): Check 1: filter selection inspection (uses empty placeholder dst, explicitly calls out that the dst dir need not exist). Check 2: real upgrade preview (uses real linux-6.6/ dst, this is the one that catches "filter written too wide" issues -- exact pattern that surfaced the recent drivers/iommu/*** bug). Check 3: exhaustive replay (vendor as fake upstream, no missing files). Also remove a duplicated copy of the replay-test snippet that was accidentally left over after a previous edit. Co-authored-by: Cursor --- linux-6.6/UPGRADE.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/linux-6.6/UPGRADE.md b/linux-6.6/UPGRADE.md index c6d1144..4513a8f 100644 --- a/linux-6.6/UPGRADE.md +++ b/linux-6.6/UPGRADE.md @@ -267,17 +267,39 @@ vim linux-6.6/.vendor-keep.rsync ### 6.5 提交前的安全检查 -正式 commit 前可以 dry-run 一次,确认 keep-list 改动符合预期: +正式 commit 前推荐做两种 dry-run,分别看不同维度的信息。 + +#### 检查 1: 看 filter 规则到底"选中"了哪些路径(最直观) + +用一个**不存在的空目录**当 rsync 的目标(`-n` dry-run 不会真的写入),让 rsync 输出"如果按 filter 把上游全量同步过来,包括哪些路径",这样不受 vendor 当前已有内容的影响: ```bash -# 假设 /tmp/linux-6.6.99/ 是上游 tarball 解压目录 +# /tmp/preview/ 只是个占位符,不需要真的存在;-n 保证不会创建 rsync -avn --filter='. linux-6.6/.vendor-keep.rsync' \ /tmp/linux-6.6.99/ /tmp/preview/ 2>/dev/null \ | grep "your-new-path" # 期望:能看到目标路径出现在 transfer list 里 ``` -更彻底的「无遗漏」回放检查(用 vendor 分支自身当伪上游,对比 git tree vs rsync 实际同步集): +#### 检查 2: 看真实升级会改动哪些文件(推荐每次升级前必做) + +用真实的 `linux-6.6/` 当目标,输出"这次升级实际会改哪些文件"。如果某个顶级目录数量异常(比如 `drivers` 一下出现几十上百个文件),多半是 keep-list 写宽了: + +```bash +# 真实 dst,能看到 src vs vendor 的差异;-n 保证不会改动工作区 +rsync -avn --delete --filter='. linux-6.6/.vendor-keep.rsync' \ + /tmp/linux-6.6./ linux-6.6/ 2>&1 \ + | grep -v '^deleting' | grep -v '/$' \ + | awk -F/ '{print $1}' | sort | uniq -c | sort -rn + +# 期望:每个顶级目录的数量都是合理范围(小版本升级一般几个~几十个) +# 异常:drivers 突然出现 90+ 文件 → 检查 .vendor-keep.rsync 是否把 +# /drivers/iommu/*** 这种规则写宽了(实际只该保留 iommu/iommufd/) +``` + +#### 检查 3: 完整的"无遗漏"回放(改了 keep-list 后必做) + +用 vendor 分支自身当伪上游,对比 git tree vs rsync 实际同步集,确认 filter 仍能覆盖所有当前保留文件: ```bash TMP=$(mktemp -d) -- Gitee