From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 1E249421255 for ; Wed, 12 Aug 2026 10:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786531770; cv=none; b=tJh9llk3mOLh8YurW/Xqz9PvMcZJ0fPhD4d/XfAFurNKuHO+kKs8kSJC759wC85Us733cU549rak1lTeViuUxmh+Rui4QHikxC7XK6m7JPXwbETC+zf6wTlHBB6Li5l8CHYRj35jZJji2VK+K4/sHp+nBv0RL7W9LWM1GkRQk5I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786531770; c=relaxed/simple; bh=YDqh6G2T3Z9d5pqEFevJxLy/1oK7TwYC6P4Rvly9S/E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Zi5S8Pqz4l8FLb9H6MUDlp6txfDU4tWUoUnW98hUwCRM5Nc9Qu7vuZvoX2UqXrPKonRiGJPXRVBsBI3dyWb1A4dEvgXJtYslei/Gv/18SZsby+32/P0knBytRKk2hvbkVPt2yVjjih7XW0bY9otkfREN/FN6nHMj9M0JnK9/NyQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=cb1+nKww; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="cb1+nKww" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=aARderwjQ6N4kQxpGMM3ujaudWzwA8axkvxYGtg/BE4=; b=cb1+nKwwBiZzY0YKxO+M/J4Utc oLwn0Cbv2qTSbjs7MdJLK9qDMiRRJXCtu7Q7HW8WhcqGmbBsK/dUEHgJlu9CCQ68HfCREZoLS4jDT IhlPjLEMslK8MvgKpZUWw/ygpPh7+8M5gZiQUIHwnQbyt4B2pxXSoneLA/RvSDIviElTg8Hy7jg43 C2QftDu/PsUPkfqlpUXApLIBDmZixqjX0ybAZZ/icio80qJuLr5Z5m0hRq00S6qj7Uk8SWLXScvF1 ZaD2XtKhO6CVzTQ3A1TjlPH1MkgZGjJLEGG22fHxxx8dPpijzrd7hUOnjzuaewzA0iXa+XsGMBvN4 ZOQNJLrQ==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wu6W7-004I0K-2V; Wed, 12 Aug 2026 10:49:04 +0000 Date: Wed, 12 Aug 2026 03:48:56 -0700 From: Breno Leitao To: "David Hildenbrand (Arm)" Cc: Andrew Morton , Chris Li , Kairui Song , Kemeng Shi , Nhat Pham , Baoquan He , Barry Song , Youngjun Park , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , Hugh Dickins , Baolin Wang , Peter Xu , Johannes Weiner , Yosry Ahmed , Chengming Zhou , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH 2/3] mm, swap: distinguish a malformed swap entry from a dying device Message-ID: References: <20260810-swap-v1-0-375ef0767206@debian.org> <20260810-swap-v1-2-375ef0767206@debian.org> 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=us-ascii Content-Disposition: inline In-Reply-To: X-Debian-User: leitao Hello David, On Tue, Aug 11, 2026 at 05:36:31PM +0200, David Hildenbrand (Arm) wrote: > On 8/10/26 18:26, Breno Leitao wrote: > > + return ERR_PTR(-EINVAL); > > } > > Is -EINVAL really the logical right return value? Running into bad swap entries > sounds more serious to me than "-EINVAL" :) Good point, maybe we need a strong drug here, what about -EIO? I picked -EINVAL because it is what the swap code already returns for this exact condition. * Returns -EINVAL if the swap entry is invalid, which might * occur if a page table entry has got corrupted. */ int swap_dup_entry_direct(swp_entry_t entry) { si = swap_entry_to_info(entry); if (WARN_ON_ONCE(!si)) { pr_err("%s%08lx\n", Bad_file, entry.val); return -EINVAL; But, I do agree -EINVAL is too soft given the situation we are in. I will return -EIO in the next version, if I don't hear any concern.