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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23A6BC433E0 for ; Fri, 10 Jul 2020 03:29:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E93A92065C; Fri, 10 Jul 2020 03:29:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="ZcQaYBkl"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="AR7D7upR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="j7Gxs+Tt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E93A92065C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net 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.90_1) (envelope-from ) id 1jtjj7-0000Wt-T6; Fri, 10 Jul 2020 03:29:29 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtjj6-0000Wl-Ux for linux-f2fs-devel@lists.sourceforge.net; Fri, 10 Jul 2020 03:29:28 +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=fNFFItOfaXD7ERVrwZbtC8Lty7deqfll5JNqU2bkwBI=; b=ZcQaYBklLsz0X94Kx1L+FF7JZQ Du1+rpZPZGM2CnK189/SCgI2q8NCYvU04TvzBCrumtJlvapBrAR5X4BHKoYYh1rr393EVmgTkYigr vGxfizm2qEN8iO65lZygJ5QMvNcjKMAB3J55v3rCsXmvv/kpzdrdPAljJsy7SR3FzFlw=; 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=fNFFItOfaXD7ERVrwZbtC8Lty7deqfll5JNqU2bkwBI=; b=AR7D7upRHzo52bQ4A3GKnTEz1i YueUskTKgmECuk7eWU0zyu5WKn7fC6njm2bZccnKJKAEtZwQ4FT6wzYNcOg+MicqW5mGnxWsEEPmW DT36Cp4xzseVgT5oCLuxYtSQuTmeA5+qjw6qZEYkZCZtf6tGarF+Ic6II8drl5vmpees=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jtjj4-00Fon6-TA for linux-f2fs-devel@lists.sourceforge.net; Fri, 10 Jul 2020 03:29:28 +0000 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 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-Disposition: inline In-Reply-To: <20200710032531.GA2805@sol.localdomain> X-Headers-End: 1jtjj4-00Fon6-TA Subject: Re: [f2fs-dev] [PATCH] f2fs: change the way of handling range.len in F2FS_IOC_SEC_TRIM_FILE 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, kernel-team@android.com, Daeho Jeong , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 _______________________________________________ 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 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A02DC433DF for ; Fri, 10 Jul 2020 03:29:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B26520767 for ; Fri, 10 Jul 2020 03:29:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594351763; bh=e7RrwGkXqrVSsYzdSn+lpqfjZspSHu0zRla4RDNhDKo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=u/GBmq1ntw8sI1pV2iBEHATU/T1jOO9Vs+MlIzI4UX3oq+uM5Jap8kEpA9cIpBRF0 SXsEVuEke8X87oB0nSD4VZgqa7s6J92MRtx89HZEeA15wfrBgA9mVvsk/y2eq37kZ2 vaKF6NzUSvqnl6aeSORElxOEc1a+fLVzXxsyAfBI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727038AbgGJD3W (ORCPT ); Thu, 9 Jul 2020 23:29:22 -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