Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp204766rdb; Mon, 15 Jan 2024 18:43:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQRcNMV4fnM8F2gJ/I7nr19LUpPRlepOkYSEkHG0C0sizXbH5VSQ28W7DNqwWInmYXPqZ8 X-Received: by 2002:ae9:e40f:0:b0:783:18f6:156a with SMTP id q15-20020ae9e40f000000b0078318f6156amr6140047qkc.125.1705373034093; Mon, 15 Jan 2024 18:43:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705373034; cv=none; d=google.com; s=arc-20160816; b=GoIXx2sq7uLaUkharcgOMoMOX0Ol4ZAr/UMr0VyZqnjvKx557ek7HuDMN4xDCQLKLO /1NP4E5DFHqtZGiEW9EqrR8HFl7vMbHeZsFU2m+gI6dQWio06ClxWX5ZbagsAOtJAOdX On77BGSU2a24KVxm1ICjL6q2TeMWmpJtRekUP/xVFLQ+TZu+xCPFtlYM/QnK5FuA4D5c DDzVdc2Sfg2NMmCfLdWvrhQURa54ibsOLDLiwbcjIKGqqsTrW8QHbBPQMw6tlbNs8tdK QFU5dC6erLvRBmjO/j0VRFuw/nbc+QqA/zpWfIZMXDStkdP8id1fj4A9dJO7X9UJeFra pr7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=JE2bpTRB25qTRW1JNAAUJiNRdS0O6dVGGU7CUmkrmSU=; fh=EIP9U8rVtjxaennZVcSCjPphbtDXKrhwpwXjxwIaHQ4=; b=JJIzla12+DtN0a0pXwS/pArYfiiR5eoDuB7V2htneQ5dPw4iGFRGix1T7wqGrN8Rnf LqL27+Th8gkvLJ7igxPfMQ69O6aX0Fa9x3FcCuSbPV/WTBT7trlmSMMReD87o1q60MBL ki1GgRWEjN6QVSoDlmw+vy7Mqj/gEavEFpQfNSzyAxYEXkpMfYO1ZonnGPMmej+RsDbB JwS2SHIjpfiqnhUyoZlQWcp0Ok4yuMTud+CKp84UZ/tHYYHXEMjnsveFE1AAIdZn+zu6 LtBKihK6KADQDCE8pj18soOchbdqC7negUmv7B/bmeIEWTmkvRvd/MYAqaOKIZAqDgBN 0Rwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=HpceYECQ; spf=pass (google.com: domain of linux-kernel+bounces-26931-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26931-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dt27-20020a05620a479b00b00783290eb64fsi8966068qkb.152.2024.01.15.18.43.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 18:43:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26931-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=HpceYECQ; spf=pass (google.com: domain of linux-kernel+bounces-26931-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26931-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C60FC1C22851 for ; Tue, 16 Jan 2024 02:43:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9542863AB; Tue, 16 Jan 2024 02:43:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="HpceYECQ" Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 BBE4C7E for ; Tue, 16 Jan 2024 02:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1705373020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JE2bpTRB25qTRW1JNAAUJiNRdS0O6dVGGU7CUmkrmSU=; b=HpceYECQKonmijXYZvgMuzJW8BGPvvYBFSKUy7G+Vxz6aNpQHVq7GNRW54DH1uFXMXobtm CtPGZYRVk1m+WaWCila1tubp/1F+HC/bNQVLPsymT8rpOYHC4YJj+7IT7Y1/BTfQiVcf6o BlHWuAD3vBaP0QqgpuJUb3omleih6Fk= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Subject: Re: [PATCH v2] fs/hugetlbfs/inode.c: mm/memory-failure.c: fix hugetlbfs hwpoison handling X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20240112180840.367006-1-sidhartha.kumar@oracle.com> Date: Tue, 16 Jan 2024 10:43:00 +0800 Cc: LKML , Linux-MM , Andrew Morton , usama.anjum@collabora.com, Jiaqi Yan , "Matthew Wilcox (Oracle)" , Miaohe Lin , Naoya Horiguchi , Yang Shi , James Houghton , jane.chu@oracle.com, stable@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <1D4F7C82-92BA-4EFC-A082-B5FE30758E91@linux.dev> References: <20240112180840.367006-1-sidhartha.kumar@oracle.com> To: Sidhartha Kumar X-Migadu-Flow: FLOW_OUT > On Jan 13, 2024, at 02:08, Sidhartha Kumar = wrote: >=20 > has_extra_refcount() makes the assumption that the page cache adds a = ref > count of 1 and subtracts this in the extra_pins case. Commit = a08c7193e4f1 > (mm/filemap: remove hugetlb special casing in filemap.c) modifies > __filemap_add_folio() by calling folio_ref_add(folio, nr); for all = cases > (including hugtetlb) where nr is the number of pages in the folio. We > should adjust the number of references coming from the page cache by > subtracing the number of pages rather than 1. >=20 > In hugetlbfs_read_iter(), folio_test_has_hwpoisoned() is testing the = wrong > flag as, in the hugetlb case, memory-failure code calls > folio_test_set_hwpoison() to indicate poison. folio_test_hwpoison() is = the > correct function to test for that flag. >=20 > After these fixes, the hugetlb hwpoison read selftest passes all = cases. >=20 > Fixes: a08c7193e4f1 ("mm/filemap: remove hugetlb special casing in = filemap.c") > Closes: = https://lore.kernel.org/linux-mm/20230713001833.3778937-1-jiaqiyan@google.= com/T/#m8e1469119e5b831bbd05d495f96b842e4a1c5519 > Cc: # 6.7+ > Signed-off-by: Sidhartha Kumar > Reported-by: Muhammad Usama Anjum Acked-by: Muchun Song Thanks.