From nobody Sat Sep 26 11:01:48 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) (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 265413E2ADD for ; Wed, 2 Sep 2026 07:33:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788334407; cv=none; b=s2yFQJwqWH1AJe8IZwjr4/XF1aUqmnl0rgbBAqKOVQxIrl6opPQWa2XcRd0L5jaaLww011MGWTjy5mLRYptjyglZg4afK119igDbJwxPN/ZK+dtFXqdrPczGzPP/oKsC/Nm1jS8OHtb0Fxz9ZJ//2RhIdUfMeuxowQpNXmEZPjY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788334407; c=relaxed/simple; bh=35iHWuYnUQtX9tgekVfOEZb8DN/7rFnryAt1ds2xyg0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YqZFMNOIsUzlkPsTyizDkUDJT3G60xd23POBZW1Ss8EFMoJaDER9sySpLAuNlby795MWwC6V0flpCIQfMPPTaoAiZGbOSjewUqD0vLygmYeJGESh/i/W5AYpVjCXqGOT03w6omYKcTs1f96r9vubBUTukS03YUaHrgP9q2fy8/Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=gIT0ZWA2; arc=none smtp.client-ip=117.135.210.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="gIT0ZWA2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=0J vgwKU2flOxnrtag/hZ68OursqVJhjrt3AmThC7Eq0=; b=gIT0ZWA2UNdkM5a8SX ikOWYI6G20HmS2CUczPqYLKxPQyG+/R2JtoNOG/m70taZwCKoPj6cUyrX9h0LcwW nnnpZZzRSq2L1ZkCK+c8zStlpWWwrmHkFwPRLQ+Ld/ppNA4ms2id4vSxbGBNo+er Vci7KA5Hsd1dr4EMoq1lwzCng= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g1-1 (Coremail) with SMTP id _____wD3x_0k0ZdqF_ZSAA--.18706S3; Wed, 02 Sep 2026 15:32:56 +0800 (CST) From: Baolin Liu To: linkinjeon@kernel.org, hyc.lee@gmail.com Cc: ntfs@lists.linux.dev, linux-kernel@vger.kernel.org, Baolin Liu Subject: [PATCH 1/5] ntfs: return -EINVAL from ntfs_collate_ntofs_ulongs() on bad length Date: Wed, 2 Sep 2026 15:32:45 +0800 Message-ID: <20260902073249.3035977-2-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260902073249.3035977-1-liubaolin12138@163.com> References: <20260902073249.3035977-1-liubaolin12138@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wD3x_0k0ZdqF_ZSAA--.18706S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7GFyfKry8tw1fXFWrGw15urg_yoW8JrW7pF 9rCFn7Ga1kJr12yrs2yr43GayavwnrGr47t390gw1xX3sYqF1rJr1FqF1Ivr4IqaykZw1F qr10q3y3ZrykZaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UMpBfUUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6Qj+yWqX0Si1FQAA3y Content-Type: text/plain; charset="utf-8" From: Baolin Liu ntfs_collate_ntofs_ulongs() returns -1 when the key lengths differ or are not a multiple of 4. But -1 is also what cmp_int() returns for "collates before", so the error is indistinguishable from an ordinary result. ntfs_ie_lookup() acts on that difference: it maps -EINVAL to -ERANGE, but treats -1 as a tree-descent hint and breaks out of the loop. A malformed entry in $Reparse/$R or $ObjId/$O is therefore silently taken as a lookup miss. Return -EINVAL, as the sibling ntfs_collate_ntofs_ulong() already does. Well-formed keys are unaffected; both indexes use key sizes that are multiples of 4. Fixes: 5218cd102aec ("ntfs: update misc operations") Signed-off-by: Baolin Liu --- fs/ntfs/collate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs/collate.c b/fs/ntfs/collate.c index 77e34038902d..744fdfd7bf58 100644 --- a/fs/ntfs/collate.c +++ b/fs/ntfs/collate.c @@ -73,7 +73,7 @@ static int ntfs_collate_ntofs_ulongs(struct ntfs_volume *= vol, =20 if (data1_len !=3D data2_len || data1_len & 3) { ntfs_error(vol->sb, "data1_len or data2_len not valid\n"); - return -1; + return -EINVAL; } =20 len =3D data1_len; --=20 2.51.0 From nobody Sat Sep 26 11:01:48 2026 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.3]) (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 DEB7E3E92A9 for ; Wed, 2 Sep 2026 07:33:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788334413; cv=none; b=IH7FBHtmXqK2C1BEFeM7KSnyZmb6esOWlVtXFQHS/qlUtETsXD3osBemOEbC9g80xkeTsly7ewvMIa/FKqOazlKYsDIh72oSzWUC1yec51eY+S8FQDUrK8u5UJ/+QZYlNGDpax8kGCBlY9O+vfHGbYvGrnFKalKt0BkB8z6kh/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788334413; c=relaxed/simple; bh=sDT7xjM0dZISfQn5a6JEPcrI4SkY98hFxbZcEi1sMFY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NUY0OyM2kTbroqnGY+i8RvkKIQe48aR7QRp+9r//gCgEu9HYc8v2qI3cz3wwhf2MtJa30SvnwCxRsX8tdi4MezCT/8HYQQJMWFeqk2QmoR2KeXX0O/vuMPTc3FE+ihI38hLCvlGxFYfh1Q0qSrdLK3+SMKpWvzd0PbW6sP1zDok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=T73qDWMb; arc=none smtp.client-ip=220.197.31.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="T73qDWMb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=rL BrRbq6Vb3Paam/kpUsHN325HJZ3rHQyjFwMyPSp0o=; b=T73qDWMblV7YD8Kcns dFf7EMNSSPecwc63i241i1W+MFbTFxre9eFt+oq+z5DZFESgN4ZxRSKIlUXC/X38 NrudZZDm6B0qPrUAlGkIi3Ek1asx8VjrzuC19b/T6lAYuNW/efvs/G4oL4KLxxj1 acrFpBA9PbJhvhUR6Rrbx7lzY= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g1-1 (Coremail) with SMTP id _____wD3x_0k0ZdqF_ZSAA--.18706S4; Wed, 02 Sep 2026 15:32:58 +0800 (CST) From: Baolin Liu To: linkinjeon@kernel.org, hyc.lee@gmail.com Cc: ntfs@lists.linux.dev, linux-kernel@vger.kernel.org, Baolin Liu Subject: [PATCH 2/5] ntfs: return -ENOMEM from ntfs_inode_attach_all_extents() Date: Wed, 2 Sep 2026 15:32:46 +0800 Message-ID: <20260902073249.3035977-3-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260902073249.3035977-1-liubaolin12138@163.com> References: <20260902073249.3035977-1-liubaolin12138@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wD3x_0k0ZdqF_ZSAA--.18706S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7GFyfAr47Xw1ftr4xWr4rKrg_yoWkZFX_C3 WfJr4kKr1YqFn5ZwsxGw1YqrnakF48GF1Iqr15JF1ay3yUtFs0yrnrJFsYy397Wr4jqr9x Jws7Gr13Zr1avjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU08pnPUUUUU== X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwgr+yWqX0SqH+wAA3F Content-Type: text/plain; charset="utf-8" From: Baolin Liu ntfs_inode_attach_all_extents() returns -1 when ntfs_extent_inode_open() fails, and both callers propagate it unchanged, so userspace sees EPERM from setxattr, reparse point creation and directory index updates on inodes with an attribute list. Both paths that return NULL here are allocation failures: the kmem_cache_alloc() in ntfs_new_extent_inode() and the kvzalloc() that grows ext.extent_ntfs_inos[]. Return -ENOMEM. Fixes: af0db57d4293 ("ntfs: update inode operations") Signed-off-by: Baolin Liu Reviewed-by tag to them. Reviewed-by: Hyunchul Lee --- fs/ntfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 5aedc045f65a..747a60ae27c9 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -3025,7 +3025,7 @@ int ntfs_inode_attach_all_extents(struct ntfs_inode *= ni) prev_attached !=3D MREF_LE(ale->mft_reference)) { if (!ntfs_extent_inode_open(ni, ale->mft_reference)) { ntfs_debug("Couldn't attach extent inode.\n"); - return -1; + return -ENOMEM; } prev_attached =3D MREF_LE(ale->mft_reference); } --=20 2.51.0 From nobody Sat Sep 26 11:01:48 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.2]) (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 D43C43E3D8C for ; Wed, 2 Sep 2026 07:33:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788334407; cv=none; b=LVPK+29dkIYGB/fZA0Q8Bwyenx+HKdURmITkapa0tqQF6ivDgubbCfsNkNChbiG0DXZl1zNwdGptvhutkxpnqO17ZMRv3WytNMURqk/gRF8aC6JpTNA9UHGNjCJ9WFLUi/UccaI2EH+QeapgDBsLwH3h+v7fvWGNUZ3cOqiOMfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788334407; c=relaxed/simple; bh=lv4rIKTEg2Rgs0zVvze95QwjEFvnGpRHGmU3/DR+ZxY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZC4igDFUe7XmXo9S6pNmuqNDLrS/w0JqKeBAPgfptJ/tPzr96fQFKqHwa0mhFkUx4XkuUv3On2ID93g8Wqp6Og70C/b/xM3vVCUfDadZB36RfQpXItZGJAx+bsMb+YCHzl7QVV4Hk6difCly/Y/wCvP7bNvdiWcz1Tf7/9mF3P4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=CN/BMsRn; arc=none smtp.client-ip=117.135.210.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="CN/BMsRn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=qU HaUjAHwUSD5N9hdEvF96JzZ0kVJ+mGXaN+ZSRCuLU=; b=CN/BMsRnfHJxDAZv+2 gfIacf+FMMbIrmG3OF2QHlElSpI4IRvs/Adb7IvvVs7LA2UVbi0LDZXO00Q+GRnh IDBtet9dX3lA5u4Vz0Wce0jq5DRqFQdM+czZ7ThRnIpwBNzN1WLuPAXgIohfzXYd JLBZ4qHgwIJmq9WEiGFkWH/kc= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g1-1 (Coremail) with SMTP id _____wD3x_0k0ZdqF_ZSAA--.18706S5; Wed, 02 Sep 2026 15:32:59 +0800 (CST) From: Baolin Liu To: linkinjeon@kernel.org, hyc.lee@gmail.com Cc: ntfs@lists.linux.dev, linux-kernel@vger.kernel.org, Baolin Liu Subject: [PATCH 3/5] ntfs: preserve the truncate error in ntfs_enlarge_attribute() Date: Wed, 2 Sep 2026 15:32:47 +0800 Message-ID: <20260902073249.3035977-4-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260902073249.3035977-1-liubaolin12138@163.com> References: <20260902073249.3035977-1-liubaolin12138@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wD3x_0k0ZdqF_ZSAA--.18706S5 X-Coremail-Antispam: 1Uf129KBjvJXoW7KFy3CF4rCF45CFW7XFWkZwb_yoW8Gw1kpr ZrJFy7Kw4Yv342gF1v9a1qqw1Yvay3tFW5tryqkw1xA3Zxtw1DtryFyw10ga1IkrW8X34j qr48uay3uFy2vrDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jWD73UUUUU= X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6gv+yWqX0Su7CQAA3j Content-Type: text/plain; charset="utf-8" From: Baolin Liu ntfs_enlarge_attribute() discards the error from ntfs_attr_truncate() and returns -1, which reaches userspace as EPERM. The discarded codes are meaningful: -ENOSPC when the attribute cannot grow, -EACCES when it is encrypted, -EOPNOTSUPP when compressed, plus -EINVAL and -ENOMEM. Most callers of ntfs_inode_attr_pwrite() compare the result against the requested length and substitute -EIO, masking this. ntfs_ib_write() does not; it returns the value verbatim, which propagates through ntfs_index_add_filename() to __ntfs_create() and __ntfs_link(), so a full volume reports EPERM instead of ENOSPC from create(), mkdir() and link(). Fixes: af0db57d4293 ("ntfs: update inode operations") Signed-off-by: Baolin Liu --- fs/ntfs/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 747a60ae27c9..9b2ff15da94c 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -3618,9 +3618,10 @@ static inline int ntfs_enlarge_attribute(struct inod= e *vi, s64 pos, s64 count, return -EOPNOTSUPP; =20 if (pos + count > ni->data_size) { - if (ntfs_attr_truncate(ni, pos + count)) { + ret =3D ntfs_attr_truncate(ni, pos + count); + if (ret) { ntfs_debug("Failed to truncate attribute"); - return -1; + return ret; } =20 ntfs_attr_reinit_search_ctx(ctx); --=20 2.51.0 From nobody Sat Sep 26 11:01:48 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) (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 23EA83E0241 for ; Wed, 2 Sep 2026 07:33:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788334409; cv=none; b=XZ0KvdYi2IL2fDPz+oduVvlhfUU1uOohiO39Yk/0tAnVHJ6GNzIoM4vh1Rx93Dw1ZfZ4WiPXkOQAJqVxgvstf+d3oZ52bvgWRBDLei9FVqWj3M057q3YNcvLVjfQDBvxMe3N3RPIf6lP1x/r6q7qPTxfbnNFIfO/WU0xB1bKAl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788334409; c=relaxed/simple; bh=PKafP8lb0aFCay6oa36sWJBe+Edb1ka0Im5fDrBFSPY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fpvZH7bx4PVMMiGOGsqzUbfIFw3Jb5UuzJ1T7WVE+N9Q/mJC/2M6UNX5dQP4toUcAkh4MbETMqJH2BSI8yPgRADoElSt5b/XGUGzYK22tOpCdBWE0Z4jv2luLWURIEw3Gndn4ooaam4iE/Sdv+ed7iJ8hjClM68qpjdoyyHeNaI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=bML7CKYc; arc=none smtp.client-ip=117.135.210.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="bML7CKYc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=7j by0+P6rbUvUIgyhSGcpxv3WBQLiKatCra9z2tZ7l4=; b=bML7CKYcvI9Q59pf4J 6G4LfYqCw4YN1oINVtllRHEp/T5+WVbq4xTJkGo4AfJIT+fDL/HjXvUr4fwrbcHA 5naBERw8kepJz6MWtpJN39EDVS8rquEgS+zTbnHDAlT0L/GKApBX/Lpa+mKpZr7y cDT9O6xr6DHoTU/m0MbShdca8= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g1-1 (Coremail) with SMTP id _____wD3x_0k0ZdqF_ZSAA--.18706S6; Wed, 02 Sep 2026 15:33:01 +0800 (CST) From: Baolin Liu To: linkinjeon@kernel.org, hyc.lee@gmail.com Cc: ntfs@lists.linux.dev, linux-kernel@vger.kernel.org, Baolin Liu Subject: [PATCH 4/5] ntfs: propagate the map_mft_record() error in ntfs_attrlist_entry_add() Date: Wed, 2 Sep 2026 15:32:48 +0800 Message-ID: <20260902073249.3035977-5-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260902073249.3035977-1-liubaolin12138@163.com> References: <20260902073249.3035977-1-liubaolin12138@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wD3x_0k0ZdqF_ZSAA--.18706S6 X-Coremail-Antispam: 1Uf129KBjvdXoW7GFy3tr45uF48ZF48AF4DCFg_yoWkZwbEva 47t3WvyFy3GF1DGan29r42yws3uw10grnxX3saqFsrtrZrKFs5Zr95Zrs8JrZ7urWUKry3 Gw1rWFyUuFySyjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU80PfPUUUUU== X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbC6g0AymqX0S27MAAA3n Content-Type: text/plain; charset="utf-8" From: Baolin Liu ntfs_attrlist_entry_add() replaces the map_mft_record() error with -EIO, so an -ENOMEM allocation failure is reported as an I/O error. Both callers pass the value on to ntfs_attr_add(), which no longer collapses it since commit 8efe00b098b5 ("ntfs: preserve error code in ntfs_resident_attr_record_add()"). Return PTR_ERR(ni_mrec) instead. Also fix the debug message. Fixes: 495e90fa3348 ("ntfs: update attrib operations") Signed-off-by: Baolin Liu --- fs/ntfs/attrlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ntfs/attrlist.c b/fs/ntfs/attrlist.c index be3086d34338..a1c00e426e80 100644 --- a/fs/ntfs/attrlist.c +++ b/fs/ntfs/attrlist.c @@ -139,8 +139,8 @@ int ntfs_attrlist_entry_add(struct ntfs_inode *ni, stru= ct attr_record *attr) =20 ni_mrec =3D map_mft_record(ni); if (IS_ERR(ni_mrec)) { - ntfs_debug("Invalid arguments.\n"); - return -EIO; + ntfs_debug("Failed to map mft record.\n"); + return PTR_ERR(ni_mrec); } =20 mref =3D MK_LE_MREF(ni->mft_no, le16_to_cpu(ni_mrec->sequence_number)); --=20 2.51.0 From nobody Sat Sep 26 11:01:48 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.5]) (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 165393EC805 for ; Wed, 2 Sep 2026 07:33:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788334411; cv=none; b=P6sX7AsESgQSalQbU2uJG6nTWPsZnDAjoSDtzzDPf6Ebsu+pNx0mx0PIPRF3LEw9wsTtdfQdB2y9dZmrqgOukXyy45n+tq12yjOrXhHT8ZszIsjsdAwAiLTG93rigajoLbkDECeiRwu9DFQzSCyJkhUgDgfPgxRgn1mVDaFtowo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788334411; c=relaxed/simple; bh=OF0VchsXAwyeBFR3RujPo4LNg9EgGyntY/P+gOn3XGM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H7bo8wpZZBm9yB80//iRkoXNJfZq1EwWQaP9io6osLcvy2nq0Xtm+KJhses3w1vByqWLssRh43+RZO3S30i3fdt2mcmIJ6Hpm10CFvtIhd6ug2n5yK03y+VZuLk9ozlCpQSMVSMnhQXJQvHKyULpKFF7GEBO8/Hl2repej9l47M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=NXtSjZkH; arc=none smtp.client-ip=117.135.210.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="NXtSjZkH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=vC Xr7BvH2aJ/WLlmao4ATdB754VnA2grj//HiiprKgE=; b=NXtSjZkHXpPN7mtS2Q 8FwhaHt0LAIPxSJdSSim99ALTH/bH5H+E3WH0tQlaIShTWLzeEUVcxmClr/SKyh9 zeeQzLxFZrA9Ejy+suwwEhvuJVK3ZxnxlaqF1mT1u2xO62BnM/bLmmKICY3bwwyT KHZKXCLsslpDA6jP6jOlWWU8o= Received: from liubaolin-ThinkPad-E15-Gen-2 (unknown []) by gzga-smtp-mtada-g1-1 (Coremail) with SMTP id _____wD3x_0k0ZdqF_ZSAA--.18706S7; Wed, 02 Sep 2026 15:33:03 +0800 (CST) From: Baolin Liu To: linkinjeon@kernel.org, hyc.lee@gmail.com Cc: ntfs@lists.linux.dev, linux-kernel@vger.kernel.org, Baolin Liu Subject: [PATCH 5/5] ntfs: propagate the ntfs_attr_iget() error in update_reparse_data() Date: Wed, 2 Sep 2026 15:32:49 +0800 Message-ID: <20260902073249.3035977-6-liubaolin12138@163.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260902073249.3035977-1-liubaolin12138@163.com> References: <20260902073249.3035977-1-liubaolin12138@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wD3x_0k0ZdqF_ZSAA--.18706S7 X-Coremail-Antispam: 1Uf129KBjvdXoWrKFy5uw15AFy3ZrW5Kry8Zrb_yoWkGrb_X3 WfJr4qkF1jqFn3Wanaka13trsYq3W0grn5KrWrKFZFyw4DJr4kXr4kKws5JFWkXrW7Gryr J3y7KFy5ur13JjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU1RnQ5UUUUU== X-CM-SenderInfo: xolxutxrol0iasrtmqqrwthudrp/xtbCwg8AymqX0S+ImQAA3V Content-Type: text/plain; charset="utf-8" From: Baolin Liu update_reparse_data() replaces the ntfs_attr_iget() error with -EINVAL, so an -ENOMEM from iget5_locked() or a read failure from ntfs_read_locked_attr_inode() is reported to userspace as EINVAL. The path is reached from __ntfs_create() via the three ntfs_reparse_set_*() helpers, so symlink() and mknod() are affected. Return PTR_ERR(rp_inode) instead. Fixes: fc053f05ca28 ("ntfs: add reparse and ea operations") Signed-off-by: Baolin Liu --- fs/ntfs/reparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs/reparse.c b/fs/ntfs/reparse.c index 1a6073e22677..2a6480211fe3 100644 --- a/fs/ntfs/reparse.c +++ b/fs/ntfs/reparse.c @@ -676,7 +676,7 @@ static int update_reparse_data(struct ntfs_inode *ni, s= truct ntfs_index_context =20 rp_inode =3D ntfs_attr_iget(VFS_I(ni), AT_REPARSE_POINT, AT_UNNAMED, 0); if (IS_ERR(rp_inode)) - return -EINVAL; + return PTR_ERR(rp_inode); rp_ni =3D NTFS_I(rp_inode); =20 /* remove the existing reparse data */ --=20 2.51.0