Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp215877ybt; Thu, 9 Jul 2020 20:28:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvnF8KzzLkHHZJ0zR2Lr1USZ8/g/0p6R6bTGxtFfHgQO9bbXr2Z7MaTKmtIayAv187xmii X-Received: by 2002:a17:906:a892:: with SMTP id ha18mr60368650ejb.462.1594351683764; Thu, 09 Jul 2020 20:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594351683; cv=none; d=google.com; s=arc-20160816; b=IDebgUUr3e7xzPiUiDlm3UZDbS/1gjSIW++AoEh5FMuyZgmG1P9Gpl6852ur9Qymx0 RAYDgwSfZqoeZhDt7vxRtSmeofPqQUkacNiwKEtr2ZadGhrNJgx2nUqXn1L1IC8y6ItB e3lOxj3y9FBga+QQDewDY/mluWxbdtygIGV2oeAkG7Z8gX+0bNZHyhYwGg//dutCwp6c wSbLBQDkWob6ZXcSj8ct7LChESxd8gwphSKXbKs3eAtrNbJCa6rOtTeL0Vn8GAK1LVhp kVihmE2Un682VvTVSssW97XVH4r+MevQt84M2XGO/X3XppkJsRQfT2FK3A+nwD/T+ua8 949w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=YoNjQxDIPI5XIINsDLCIvlNnhsTROJTP9WFdFHXOM3U=; b=rlG9iE7I3QJXrHVJBNIhTE4UojxcinB3jbX+f9JdyqHARtYJo5eY7WwIf1BJZuX3mq y35gokGdFvBqxiR5jsich6lTwmwW81YZb8OuQF8qviJB8ZIK7xueVRrMmkprwZzhSyb2 taj6K+/jPC5CU/j+WYb/MWamCLZ6GWG6b2grSQM+wSoZGaaPfciMMGDFOOQ5VbVkk8hu c4GnAd8TN+jHhB3tCd37D1wNbXPxChRcuvqnsS1fTpHc1oPUywTFoUtfLlc04PHJ5V5g AHCIqPwZEzMEg9Jnds0fa2kDSxBzs8Q3eGL6hGd5+hfLR000Vi5HN/zqbcGW8EWniTyl DDPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ejAQEHyY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sd17si3355145ejb.306.2020.07.09.20.27.41; Thu, 09 Jul 2020 20:28:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ejAQEHyY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726768AbgGJDZd (ORCPT + 99 others); Thu, 9 Jul 2020 23:25:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:53308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726495AbgGJDZd (ORCPT ); Thu, 9 Jul 2020 23:25:33 -0400 Received: from sol.localdomain (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D14EA2065C; Fri, 10 Jul 2020 03:25:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594351533; bh=yu4mEjxbnjkjZzRIjB5mnWuk0m2YiSQbrdpmN1gRhqM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ejAQEHyYdq51BJ0MUh+81fQkYKHt0zpT5KoWtQR8dvJE0AAqcyuSwvH3KKtG8nrnQ AtX+6ruou0CVTsqc8g7FTaboCuPTZIAaPg796ivBI+LmRB/iqhhTyWyDmjz/AtFMKe A02HtIsjKAGeaS72AvpGCReSZmpaSA5jfQkioyR0= Date: Thu, 9 Jul 2020 20:25:31 -0700 From: Eric Biggers To: Jaegeuk Kim Cc: Daeho Jeong , Daeho Jeong , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE Message-ID: <20200710032531.GA2805@sol.localdomain> References: <20200710021505.2405872-1-daeho43@gmail.com> <20200710030246.GA545837@google.com> <20200710032035.GB545837@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200710032035.GB545837@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 09, 2020 at 08:20:35PM -0700, Jaegeuk Kim wrote: > On 07/10, Daeho Jeong wrote: > > 1. The valid data will be within i_size. > > 2. All the trim operations will be done in a unit of block, even if > > i_size is not aligned with BLKSIZE like the below. > > > > index = F2FS_BYTES_TO_BLK(range.start); > > pg_end = DIV_ROUND_UP(end_addr, F2FS_BLKSIZE); <= BLKSIZE aligned > > > > Are you worried about the case that sudden power-off occurs while a > > file is being truncated? > > ex) 1GB file is being truncated to 4KB -> sudden power-off -> > > i_size(4KB), i_blocks(maybe somewhere between 4KB and 1GB) > > Yes. Basically, I believe we can have some data beyond i_size like fsverity. > Note that fs-verity files are read-only, and therefore this ioctl can't be used on them (since it requires a writable file descriptor). So that case doesn't need to be handled here. - Eric