Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp949362ybg; Wed, 10 Jun 2020 18:59:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtGBAxPTXVWuI9Yji4OfGya0ZDVg5aXvNnMzE+cnyfq6QW2kMXt8GX58S1LHWdifippSXm X-Received: by 2002:a17:907:212b:: with SMTP id qo11mr6400763ejb.235.1591840750783; Wed, 10 Jun 2020 18:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591840750; cv=none; d=google.com; s=arc-20160816; b=JqEU6jOYM9D3yKknbKZKIwXARbehdfzuUjiMdxdKrNg7tIZbRdoCkEgIA185VUdYLY 6uStsGJXqppw2cP1V+JO4FLX+PcMmG0DCYKc281CqZAmvALkJsi1OSJnitiSRKy/VYnJ ehYKMKTo5I3uLQ7AWq6KNZB7KTLWmOl4DcPmMt1Cd+eQ76O7uN77gRECz3j4uf5h23Y3 2RAGgpFonPGNbP6nyBgOyGLwFw3bBj+RfACGL2GZ/R6XfjZKt8HROZM2C0DFxJgNY2/A /oca1nyQaoR9Hk37DhBN9inqamXIow3JfFj1QrGTxIDgPMAtiIvP4lHYgyvHcL2VWDXO iglg== 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=rCEELQ10cAEaYFE3jTuOOYH4NFcDNsZP5Kog6izu/lA=; b=NNzsC1C0uQZQjhbYz+hXptAa+Hl4iknL+qo2fR3F/3J62iqkYXkhgqCWvRooXICh1N es3Wy9mwE1W/ZdwCdpP66LBQYhJLHFhtboIjY+kEM4lDsRqKEQ5IQLUU+LmqpOuV1YAB ohTML8i4ZSAW2XJvNMiQ0Dw3EtQV71vsGTLynLyohD4uLZOM4Bs+kehMuhKslArPdg9t zgI06mbYncbhr5llLKTwZsVfgAx4rhugSNRyOEx8ki78uKSCZ43W1/t59u1c1JRiyFSo 8eeSm121Uoi1asB6cczK/XcFnOaze7UHV/g4dculsvPV5ydzFW3oAmOMX8PgR9auDCpP LAcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ENNLJwPC; 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 d15si395607edp.112.2020.06.10.18.58.47; Wed, 10 Jun 2020 18:59:10 -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=ENNLJwPC; 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 S1726387AbgFKB4x (ORCPT + 99 others); Wed, 10 Jun 2020 21:56:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:55866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726326AbgFKB4w (ORCPT ); Wed, 10 Jun 2020 21:56:52 -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 5A1A2206FA; Thu, 11 Jun 2020 01:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591840612; bh=beGVc6bpHeiEA8//p9B6LnBQfT/NH139uiChyIVI8JM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ENNLJwPCrxED6GSeVc0lD6UMH8JWHDkxknOIE9Liy/jbqoCAuPZvUb2lHh+7Hi11g lpQyL9iP/WG0xcg97vS2Zl+6LgrB7/hJXnWZ2g8ocl6qMmFfXLuMayp2HXHZk/IAwB oc570nKJrn8AsZfX6H9xyEsZVETqdz6tHAvtUJY4= Date: Wed, 10 Jun 2020 18:56:51 -0700 From: Eric Biggers To: Daeho Jeong Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Subject: Re: [f2fs-dev] [PATCH] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl Message-ID: <20200611015651.GD1339@sol.localdomain> References: <20200609060137.143501-1-daeho43@gmail.com> <20200609165107.GA228564@gmail.com> <20200610031532.GA6286@sol.localdomain> <20200611000037.GC1339@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 11, 2020 at 09:23:23AM +0900, Daeho Jeong wrote: > Yes, I saw the implementation in vfs_write(). > But if we use mnt_want_write_file() here, it'll call mnt_clone_write() > internally if the file is already open in write mode. > Don't you think the below thing is needed? We can increase the counter > each of them, open and ioctl, like other filesystems such as ext4. > > int mnt_clone_write(struct vfsmount *mnt) > { > /* superblock may be r/o */ > if (__mnt_is_readonly(mnt)) > return -EROFS; > preempt_disable(); > mnt_inc_writers(real_mount(mnt)); > preempt_enable(); > return 0; > } No, this seems to be left over from when mnt_want_write_file() was paired with mnt_drop_write() instead of mnt_drop_write_file(). I sent a patch to remove it: https://lkml.kernel.org/r/20200611014945.237210-1-ebiggers@kernel.org - Eric