From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 44A84409265; Tue, 25 Aug 2026 13:53:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787666006; cv=none; b=UcVWiS3OixYVWWWeY8ShGArWh4djh3hGtiwUNsjsN2gFGAMShwa3pv08BPDTXGCXhGXh6+soe/zsfs5Xtd/WF1RHO5BhBWjQwJwaZjdRkQHhxGopujmT+zaopt4AdJZXQ+z0ozjDhSmopNcLJaXn5s6R/1Or2fWfux5MbOAd5UI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787666006; c=relaxed/simple; bh=NkLLyQP/6AA67DGb5JJ9sVBl8Uf4BTA7RqRr2z0YBXM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=REG5FOJY6RfOHSGqRkD0ODIiFUvgfVdrjLGTTUbp3kfMOP3O6HTeYndtGwM9B+Ah0Jxlag+/A/jSbQbbVN1uEW2KUinXeRCOOKabwhBZdexdjbFAknUXvAJp18KKWZpSKtosVwUFYHKA1p8DUVZN3s/JYCmNpgvP8gogrXxY7rA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UrSz6oo0; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="UrSz6oo0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 974691F000E9; Tue, 25 Aug 2026 13:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787666005; bh=rQDVV3xSm0X40XHYkDPpJ8qrdHGVSk9Cz8UyHkxaiNE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UrSz6oo0YrCOmpS7UaUKMr4cMbxYYk+i0RwdwEQUxDQ03KC4llH2sUJFmhbsqkldo 76zvkZgt7/jaKoB2b7RU6rqNN1+TA7bsogRoeazVxN34yXNwXfgsMMEzOEq+XxYeYv +rAgGxWuJ2A0JF9FnkWDnhTU8XNnEbZt0XQokG+A= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guanghui Yang <3497809730@qq.com>, Jan Kara , Theodore Tso Subject: [PATCH 6.1 09/79] ext4: clear error before retrying inode xattr space fallback Date: Tue, 25 Aug 2026 15:25:49 +0200 Message-ID: <20260825132542.027403591@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260825132541.677185791@linuxfoundation.org> References: <20260825132541.677185791@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guanghui Yang <3497809730@qq.com> commit 409a7f12a0933ff2c617fa814c76cef0bd1d457a upstream. When ext4_xattr_make_inode_space() returns -ENOSPC, ext4_expand_extra_isize_ea() can retry the expansion with s_min_extra_isize. If that retry succeeds by finding enough ibody free space, control jumps directly to the shift label. The previous -ENOSPC is still stored in error in that path, so the function can update i_extra_isize but still return -ENOSPC to the caller. Clear error before retrying so a successful fallback expansion returns success. Reproduced with an ext4 image using 1 KiB blocks, project quota support, 256-byte inodes, and min_extra_isize/want_extra_isize set to 32. FS_IOC_FSSETXATTR failures dropped from 802 to 86 after the fix. Fixes: 69f3a3039b0d ("ext4: introduce ITAIL helper") Cc: stable@vger.kernel.org Signed-off-by: Guanghui Yang <3497809730@qq.com> Reviewed-by: Jan Kara Link: https://patch.msgid.link/tencent_192F8A699EFD21126E02101131C9546F3C08@qq.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/xattr.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -2783,6 +2783,7 @@ retry: s_min_extra_isize) { tried_min_extra_isize++; new_extra_isize = s_min_extra_isize; + error = 0; goto retry; } goto cleanup;