From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) (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 1774636EA9B for ; Tue, 31 Mar 2026 05:28:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774934896; cv=none; b=dhPGc9Vrr7MA1VEPnCJsPP1fHwvgMkHJxNrz/PW/Z9qRgiY6mdwswK8zShxA6USbSOtBuWo5yJlOwZc3WhKty4ZeMoIcuQakZreAoB9MT7tim39dtJfvZFGMA3q8ZdDRRFve4cWN4ubprp71PtpgbMYV7Xf3UuIafyFbNl2U/00= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774934896; c=relaxed/simple; bh=Smtd8ijdNMJOx63plRljHTM2ziNkG8HcBf/mXek0dFQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nzBHLouKu9Le6UfBy9sMW93IvfJNlW/JEE4Btg5H0s92wi0txdTG/NjHu6y4sD2OrZ51CTBigWXuek5nHcs3VrbAEGWXN1wAvjCmqgICBmpUCTV1kS2fgcPgB6AwhKD8j1bYZUPDF88qmMNlmodX4TEpTPnrHNuUWTLoqgkWfP4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=EpsmJe6H; arc=none smtp.client-ip=115.124.30.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="EpsmJe6H" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1774934890; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=ogj23MIlXy9IMvVJnKL5M0xMJOYH8/jMO86tAlwXGGw=; b=EpsmJe6H1IEzvsaZrX5U4PdvDvmJEj0dUqjoBlOXZ7QJnB9xOD4XC3faohQ6cibNkvWO7wQU0b/k6wVNEfg4pCjyKaX1uHBsE9pgGvRMObUYNi2Nn18Rxo1l92iqKdZc0YHXbfx0LuAT2Pv1uMgEgcbwO2QGRYV0z5BT8ePciUU= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037009110;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0X03DC23_1774934889; Received: from 30.221.131.145(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0X03DC23_1774934889 cluster:ay36) by smtp.aliyun-inc.com; Tue, 31 Mar 2026 13:28:09 +0800 Message-ID: Date: Tue, 31 Mar 2026 13:28:08 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [PATCH v3] erofs: ensure all folios are managed in erofs_try_to_free_all_cached_folios() To: Zhan Xusheng , Gao Xiang Cc: linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, Zhan Xusheng References: <1828ed19-e9d0-4908-926a-0e0a9c3d04af@linux.alibaba.com> <20260331050249.23662-1-zhanxusheng@xiaomi.com> From: Gao Xiang In-Reply-To: <20260331050249.23662-1-zhanxusheng@xiaomi.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2026/3/31 13:02, Zhan Xusheng wrote: > folio_trylock() in erofs_try_to_free_all_cached_folios() may > successfully acquire the folio lock, but the subsequent check > for erofs_folio_is_managed() can skip unlocking when the folio > is not managed by EROFS. > > As Gao Xiang pointed out, this condition should not happen in > practice because compressed_bvecs[] only holds valid cached folios > at this point — any non-managed folio would have already been > detached by z_erofs_cache_release_folio() under folio lock. > > Fix this by adding DBG_BUGON() to catch unexpected folios > and ensure folio_unlock() is always called. > > Suggested-by: Gao Xiang > Signed-off-by: Zhan Xusheng Reviewed-by: Gao Xiang Thanks, Gao Xiang