From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout07.his.huawei.com (canpmsgout07.his.huawei.com [113.46.200.222]) (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 25E833D8101; Tue, 9 Jun 2026 07:58:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.222 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780991899; cv=none; b=Jq4nDp6Dr03TWKr30ZihMnjMwY022yor/FyqpvQxTbFEcZ65ugu0W9qzr5QB9fglMZ1oSocFajoC1hctciknbu/0UV0+l1d/0VhnUaJg4Rx4PZ5Xa4mqfFHTg7bpsfnov5vCGsh47gVjUvkn9MZmNZIQTMRSfr/XICy5O2M7Y88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780991899; c=relaxed/simple; bh=l97AYm4yo1vd1g+PINyqk9y3n50GZKNqoO5F7+cnl0g=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=WzvTZ/9lxVI+f5pB7a4FSAjVHCVxfjuJ/7tNob/PGSLcPAM3UDb+fI22MsJAa8vjASophylMHQSp9DtfCcPO4Z29x9g9sp/wgEww6MCNgwzrLivU+lIUfadWf0T7pv+hH53eeOYB48dl52ON0rlqBXYND/zUdCsPuxHgzp11hGY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=neXony9Q; arc=none smtp.client-ip=113.46.200.222 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="neXony9Q" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=aZW27Z0cG5ZBxv+2DhR3no8vztYQbkpn9oxsBKpw1oU=; b=neXony9QCUc1tse0odsjp7be85xjmajBOkbHWEkkmavuVuUTUb5tf1zrE2TlNpkIaLDj8LeEX wC9dtZwjGcb+Avq4dCXAGUsaIKrs62aMIaLXnxiaeFz+I1Efoh1t72/I7nrI7zL6GoESbeQXANz +u1mwXlQ4+DUOXVVHfox6JM= Received: from mail.maildlp.com (unknown [172.19.163.127]) by canpmsgout07.his.huawei.com (SkyGuard) with ESMTPS id 4gZLft36s7zLlvJ; Tue, 9 Jun 2026 15:50:14 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id 99E7B402AB; Tue, 9 Jun 2026 15:58:07 +0800 (CST) Received: from kwepemq500010.china.huawei.com (7.202.194.235) by dggemv706-chm.china.huawei.com (10.3.19.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 9 Jun 2026 15:58:02 +0800 Received: from [10.173.124.160] (10.173.124.160) by kwepemq500010.china.huawei.com (7.202.194.235) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Tue, 9 Jun 2026 15:58:00 +0800 Subject: Re: [PATCH v4 3/7] mm: shmem: Update shmem handler to the MF_DELAYED definition To: Lisa Wang CC: , , , , , , , , Naoya Horiguchi , Andrew Morton , "Paolo Bonzini" , Shuah Khan , Hugh Dickins , Baolin Wang , "David Hildenbrand" , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , , , , References: <20260602-memory-failure-mf-delayed-fix-v4-0-a5bc7db5a9b2@google.com> <20260602-memory-failure-mf-delayed-fix-v4-3-a5bc7db5a9b2@google.com> From: Miaohe Lin Message-ID: Date: Tue, 9 Jun 2026 15:58:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20260602-memory-failure-mf-delayed-fix-v4-3-a5bc7db5a9b2@google.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: kwepems100001.china.huawei.com (7.221.188.238) To kwepemq500010.china.huawei.com (7.202.194.235) On 2026/6/3 5:55, Lisa Wang wrote: > To align with the definition of MF_DELAYED, update > shmem_error_remove_folio() to return MF_DELAYED. > > shmem handles memory failures but defers the actual file truncation. The > function's return value should therefore be MF_DELAYED to accurately > reflect the state. > > Currently, this logical error does not cause a bug, because: > > - For shmem folios, folio->private is not set. > - As a result, filemap_release_folio() is a no-op and returns true. > - This, in turn, causes truncate_error_folio() to incorrectly return > MF_RECOVERED. > - The caller then treats MF_RECOVERED as a success condition, masking the > issue. > > The previous patch relays MF_DELAYED to the caller of > truncate_error_folio() before any logging, so returning MF_DELAYED from > shmem_error_remove_folio() will retain the original behavior of not > adding any logs. > > The return value of truncate_error_folio() is consumed in action_result(), > which treats MF_DELAYED the same way as MF_RECOVERED, hence action_result() > also returns the same thing after this change. > > Signed-off-by: Lisa Wang Acked-by: Miaohe Lin Thanks. .