Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp217970ybt; Thu, 9 Jul 2020 20:32:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyALqQ+LfZVJcJkzTNwekmQu/wvdgFuFsMY6CGAml49a3rpdEfhpd4tb5Fag8a4J94lXvzw X-Received: by 2002:a17:907:20af:: with SMTP id pw15mr61700597ejb.204.1594351951924; Thu, 09 Jul 2020 20:32:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594351951; cv=none; d=google.com; s=arc-20160816; b=g7atITNODUhCG0+6GvmtfCORwOBKr2cDsYLLzHmQRpD0HY/DA4UJebmXrxObDFlXV7 Gk9ypT2t0hA7Q+mdvITFzxfqb56ysCGhWgRkHghcUyAxhpy4KidCxUrbyETkN9wnw9tW FNrjCAsJ0UZisfTE2hikCBhecNR1k9qRLefRwtTSrj3VSNTUYTc38NswgtMTJjTwrH6i pZNyr+L8AcERlDOA/M9UmLj3U9RCaGhh8Bh3i4VbFEO4cdDwjNIw16z0We4bTm08Iia+ JuJt+r8IpybtFAbC1RYNXO+zcZZwPbpk7/RpAmew6o5BSv45npsRmmE4n2RQkUGVkw5s GvFA== 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=fNFFItOfaXD7ERVrwZbtC8Lty7deqfll5JNqU2bkwBI=; b=x/fxu0s5Duu7+TaECW0lec2hG+iQzig9R1ulaGF9Xs2XcUnJQVWwtD40FUCteXI42h 5nTCY/7g4+Lh4Shc2OF1jzsLcCcKotS1XiWmdwXUz4WunooVJAob3apAYFj5BNhXVjfa e0eZ2CHXDafx1WjYdPDvogQOhwXkkmqQBHTknFJSwEaw9cSrRgin0BHNRFII28RaAyoi kl5ln7j7r4u1pNEX31GPFV0SxQ+mJUJ1wg7wk/xf6X+Nh0om5mRdF9Ga4hWF8FU2NRaD aIKDWn8PkhVI+E7zE9+xDzfxNN0VyhqCnRI8X8Dx/EHs7/oloFvNxCmJI36xIAoxNMSJ FeZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j7Gxs+Tt; 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 t25si3281680edr.537.2020.07.09.20.32.09; Thu, 09 Jul 2020 20:32:31 -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=j7Gxs+Tt; 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 S1726965AbgGJD3V (ORCPT + 99 others); Thu, 9 Jul 2020 23:29:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:54948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726495AbgGJD3V (ORCPT ); Thu, 9 Jul 2020 23:29:21 -0400 Received: from localhost (unknown [104.132.1.66]) (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 8A4E42065C; Fri, 10 Jul 2020 03:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594351760; bh=e7RrwGkXqrVSsYzdSn+lpqfjZspSHu0zRla4RDNhDKo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j7Gxs+TtA7tcTqK+OqXwVqHq5m+V05mq3vs44EP/PBsF46VVLvI8lMOzmXef/0xaJ iwOGuS6uXF9bGw+HJCo9VBoIVz5mVd2sYaYZW8j/VelURm+t8Rgw3MoqE0NfILThLl Q1yQF2EZLRYB2VswIrhnZmBgKGaOjkJi6oK1pn88= Date: Thu, 9 Jul 2020 20:29:20 -0700 From: Jaegeuk Kim To: Eric Biggers 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: <20200710032920.GD545837@google.com> References: <20200710021505.2405872-1-daeho43@gmail.com> <20200710030246.GA545837@google.com> <20200710032035.GB545837@google.com> <20200710032531.GA2805@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200710032531.GA2805@sol.localdomain> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/09, Eric Biggers wrote: > 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. I meant it as an example of valid data beyond i_size. > > - Eric