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 7ABC5C64EC7 for ; Mon, 13 Feb 2023 18:04:21 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pRdBc-0007d5-2k; Mon, 13 Feb 2023 18:04:19 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pRdBa-0007cy-Kf for linux-f2fs-devel@lists.sourceforge.net; Mon, 13 Feb 2023 18:04:17 +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=TR+ZxE36P95Yfkr1b9gPEdccwFwujLrd73riunmoQOI=; b=d/S7A0R4VTluThGjezPU6cP5O0 LqUgZN3SERVF5pdE1ILQbVEgJRjiO2ePkFIcutLco11cdO0OCntdzgClXMjgP3nfrQsd3lEMMc8b5 GTd/7NjS06e75MIPI+zo4fR8nouZBe+CWMhRF3Y/Hh6tytcXDCqJlV5PHHNS3dWjMGLI=; 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=TR+ZxE36P95Yfkr1b9gPEdccwFwujLrd73riunmoQOI=; b=edM+ql5z+6/4bSDi9EJIcMP3w8 v7CGsroZAsBbrlUr2OmDEZXUgTbGP0tH7V3OU25S79ghGRm04EsJeSM17kkXH0m1eu/CxPjjaKOTM use1dtHtpKZWeUB+3P/BvLFsRDMrkXXpDQqZ/PQ4hSlAvyDCYYj9bSViZF7J3NGs+pMo=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pRdBY-0002Hx-D6 for linux-f2fs-devel@lists.sourceforge.net; Mon, 13 Feb 2023 18:04:17 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C35E86121F for ; Mon, 13 Feb 2023 18:04:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23A6AC433D2; Mon, 13 Feb 2023 18:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676311451; bh=jl2zLZQEi/b6cx6PVSR62juBYlUQyWBIxbakuTBb/NQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sQpVcF/sakhc7iNXkRTjQ74bDVe5+X8CDeR+H0yGM242a0uC95ZbeGCFos5agmstE QxR92oW/tKc+shHT1OpfLR73g0iaFHkdq0gHaVLdqgG6DCxVZofHwSpF/9F3dmORBo vKo1z6rMXGQn5EMfDhPYSYfvwfGa/j04Wi/V43an8708Tyu1HBEbawHUnyubE2hW4n iKT5XK5uId5ojAWB4sM0GQsesMq9d2X8P1ShDh4bJEsC/0O8LkvlzmwfaKE7IzdI26 n0+dxmIHBfpQgGGwYg6WWDEOJ3Bn70DrZbvtmoa08YWp6RUE/mRyxbK5boHr76pcLK 7EIcNu7tIDa3w== Date: Mon, 13 Feb 2023 10:04:09 -0800 From: Jaegeuk Kim To: Chao Yu Message-ID: References: <20230208212502.339427-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Headers-End: 1pRdBY-0002Hx-D6 Subject: Re: [f2fs-dev] [PATCH] mkfs.f2fs: trim all the devices except the first one 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: , Cc: 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 02/13, Chao Yu wrote: > On 2023/2/9 5:25, Jaegeuk Kim wrote: > > We need to check the first disk only, and trim the other disks. > > I'm confused, why we don't need to trim first disk? dd9c372646ed ("mkfs.f2fs: check zeros in first 16MB for Android") - We actually don't need to issue trim on entire disk by checking first blocks having zeros. This is what Android checks when to decide format as we expect the first disk was supposed to have a written superblock. That's not for secondary disk and so on. > > Thanks, > > > > > Signed-off-by: Jaegeuk Kim > > --- > > mkfs/f2fs_format_utils.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/mkfs/f2fs_format_utils.c b/mkfs/f2fs_format_utils.c > > index 597c2b3a7b1c..448fbaa8866e 100644 > > --- a/mkfs/f2fs_format_utils.c > > +++ b/mkfs/f2fs_format_utils.c > > @@ -129,6 +129,10 @@ static bool is_wiped_device(int i) > > int nblocks = 4096; /* 16MB size */ > > int j; > > + /* let's trim the other devices except the first device */ > > + if (i > 0) > > + return false; > > + > > buf = malloc(F2FS_BLKSIZE); > > if (buf == NULL) { > > MSG(1, "\tError: Malloc Failed for buf!!!\n"); _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel