From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41608C3ABCB for ; Mon, 12 May 2025 15:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:In-Reply-To:MIME-Version:References: Message-ID:To:Date:Sender:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=baHgUy/Fm2C21pYxOy2g6DA6C8CG4j9n1FOAelSFvlQ=; b=FQ1wpIt12cr9vxSGyzhdujW0mZ VIDi1AJcThAnbfb/bOaiv7624TmCC0w8jNmXRGACjhr69lmiLZ6goP8qzXsTiQliKLqLIqzboLRoI Ep7fxNH+uyFwBJHVf/TFa9MV2+hj8nq+vu4IHNd0OsSjYrcs78OEqZ6ESAqQVe30YM/g=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1uEV3q-0002m5-PQ; Mon, 12 May 2025 15:27:22 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1uEV3p-0002lt-Gz for linux-f2fs-devel@lists.sourceforge.net; Mon, 12 May 2025 15:27:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=clXgqY6LG38+ty9Ld5e8w0GjJ7NFJiLwoD6+8f6rqns=; b=dFjBLmyClCbhhE4L3nqTvt2juH dHz8NnConwcMS3CSEW3aDE7ZtJBY2cy2zyr1IGeUcX67GXlwFLg8Fs7G4md53ARaai9PhsAOFz9OG ncvCK2z4WwasnAkqbZGrzSWp1gs6KpA77Dpoxusr6w9oi1T1d4f07N0VpCbUpq36s1JI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=clXgqY6LG38+ty9Ld5e8w0GjJ7NFJiLwoD6+8f6rqns=; b=LQYoeCZ/5dnPXKy716E8c+L9Vc KTTsy35NZWH1tiCDr9T29mI+62ZTOq79t6AwoJTzNRmd0FyV933X+CjrbP6vQK1ojwusdLY1KIarm CjUbbw792YSPXsq3Le5saKs3vHduZXUPqOEU6gC7fmiCIESTPgMxLvZktBWUVIvIJsOw=; Received: from tor.source.kernel.org ([172.105.4.254]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1uEV3o-0001a9-Qe for linux-f2fs-devel@lists.sourceforge.net; Mon, 12 May 2025 15:27:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 23A6E629D0 for ; Mon, 12 May 2025 15:27:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC177C4CEE7; Mon, 12 May 2025 15:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747063629; bh=R1srgJZKiVKfqoiHkN2fnKJzVCfbE1bdF6q6xYCtsyI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KMZVXZ4aQIytHkvaKeT0brW0iZxzznXFdO7CHRHBWHzAA2FEsosRJRcZki7B+NVH2 cwIjylxq4F6Xrk3QDR2e8aOdiANknoWCR1LbbIP9EPCh3RxofKRSUTCHgmPwP/2P4m LDX1xQrN1UGqilYJJ/6KmD4GqVhvTfV2AtHn+gb4ce0SCrl47ga9bTukIuek7+/Xt6 bUgFdTFa521ICv3GfbYys5hmjhl6EJx9134nB0DkYBvA3GanUFEoxKX/f6fIv4BNJk man5047KgW+3eDNuVXJAnMoSp7YRrjNB9OpKcMP4wnlMVICfruegexChJTAVXRA2eZ GlUJto5X+mMFg== Date: Mon, 12 May 2025 15:27:08 +0000 To: Chao Yu Message-ID: References: <20250512115442.2640895-1-chao@kernel.org> <20250512115442.2640895-2-chao@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250512115442.2640895-2-chao@kernel.org> X-Headers-End: 1uEV3o-0001a9-Qe Subject: Re: [f2fs-dev] [PATCH 2/2] f2fs: add f2fs_bug_on() in f2fs_quota_read() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jaegeuk Kim via Linux-f2fs-devel Reply-To: Jaegeuk Kim Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 05/12, Chao Yu wrote: > mapping_read_folio_gfp() will return a folio, it should always be > uptodate, let's check folio uptodate status to detect any potenial > bug. If it's supposed to be uptodate, can you add f2fs_bug_on() only? > > Signed-off-by: Chao Yu > --- > fs/f2fs/super.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index 0ee783224953..ea207a9edc10 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -2973,6 +2973,17 @@ static ssize_t f2fs_quota_read(struct super_block *sb, int type, char *data, > goto repeat; > } > > + /* > + * should never happen, just leave f2fs_bug_on() here to catch > + * any potential bug. > + */ > + if (unlikely(!folio_test_uptodate(folio))) { > + f2fs_folio_put(folio, true); > + set_sbi_flag(F2FS_SB(sb), SBI_QUOTA_NEED_REPAIR); > + f2fs_bug_on(F2FS_SB(sb), 1); > + return -EIO; > + } > + > memcpy_from_folio(data, folio, offset, tocopy); > f2fs_folio_put(folio, true); > > -- > 2.49.0 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 569861E503C for ; Mon, 12 May 2025 15:27:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747063630; cv=none; b=FyzMsjrzZPGr+yYuZNPOJXFlkDBz/aJ4g9Mb29MpD6ht13Um0Qp0xzjs35sJS/9/G0gINrCRAxLYwBZBGbRD466F2Dqtaqb0a2OVbuJLKWaDsT2PUrQKlsZnk8zZW87Wgi9HK5Ri2CB8NR/IvpEyeTzJtR9l1BnK9D1Fb1mxUjo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747063630; c=relaxed/simple; bh=R1srgJZKiVKfqoiHkN2fnKJzVCfbE1bdF6q6xYCtsyI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eHGABBPt6WR1D04vlfgFwz5VQ1dYEMuUeYg8P4qALWS6VIndA8HACkc7VzN1RzALnKc/phV16is4u9OR3CybPz1UdvTfV32x+Pzz0GIgJlHMM27rVUdEPzhcjxSzvvXEI3QFamRSUoWfmXlsvc8TLHmCaCi8vFPi64nQpKV7k28= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KMZVXZ4a; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KMZVXZ4a" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC177C4CEE7; Mon, 12 May 2025 15:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747063629; bh=R1srgJZKiVKfqoiHkN2fnKJzVCfbE1bdF6q6xYCtsyI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KMZVXZ4aQIytHkvaKeT0brW0iZxzznXFdO7CHRHBWHzAA2FEsosRJRcZki7B+NVH2 cwIjylxq4F6Xrk3QDR2e8aOdiANknoWCR1LbbIP9EPCh3RxofKRSUTCHgmPwP/2P4m LDX1xQrN1UGqilYJJ/6KmD4GqVhvTfV2AtHn+gb4ce0SCrl47ga9bTukIuek7+/Xt6 bUgFdTFa521ICv3GfbYys5hmjhl6EJx9134nB0DkYBvA3GanUFEoxKX/f6fIv4BNJk man5047KgW+3eDNuVXJAnMoSp7YRrjNB9OpKcMP4wnlMVICfruegexChJTAVXRA2eZ GlUJto5X+mMFg== Date: Mon, 12 May 2025 15:27:08 +0000 From: Jaegeuk Kim To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] f2fs: add f2fs_bug_on() in f2fs_quota_read() Message-ID: References: <20250512115442.2640895-1-chao@kernel.org> <20250512115442.2640895-2-chao@kernel.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: <20250512115442.2640895-2-chao@kernel.org> On 05/12, Chao Yu wrote: > mapping_read_folio_gfp() will return a folio, it should always be > uptodate, let's check folio uptodate status to detect any potenial > bug. If it's supposed to be uptodate, can you add f2fs_bug_on() only? > > Signed-off-by: Chao Yu > --- > fs/f2fs/super.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index 0ee783224953..ea207a9edc10 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -2973,6 +2973,17 @@ static ssize_t f2fs_quota_read(struct super_block *sb, int type, char *data, > goto repeat; > } > > + /* > + * should never happen, just leave f2fs_bug_on() here to catch > + * any potential bug. > + */ > + if (unlikely(!folio_test_uptodate(folio))) { > + f2fs_folio_put(folio, true); > + set_sbi_flag(F2FS_SB(sb), SBI_QUOTA_NEED_REPAIR); > + f2fs_bug_on(F2FS_SB(sb), 1); > + return -EIO; > + } > + > memcpy_from_folio(data, folio, offset, tocopy); > f2fs_folio_put(folio, true); > > -- > 2.49.0