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 9BD70C433DF for ; Thu, 11 Jun 2020 01:57:04 +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 60E2F206FA; Thu, 11 Jun 2020 01:57:04 +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="OpGAm5c4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="Hrn32vCK"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ENNLJwPC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60E2F206FA 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 1jjCSk-00071i-O7; Thu, 11 Jun 2020 01:57:02 +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 1jjCSi-00071R-Q2 for linux-f2fs-devel@lists.sourceforge.net; Thu, 11 Jun 2020 01:57:00 +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=rCEELQ10cAEaYFE3jTuOOYH4NFcDNsZP5Kog6izu/lA=; b=OpGAm5c4y7U2O9Ygju92RqZef6 54bwQkNwVl1NazJtxZJOESZHgKW4nVwiy7Jfk9R39Pqd63sP3o9M4l98Vr8aRljDStek/b7F5mXUM oay4CHpaNFstHVd8NG8ppwyq1hBl7WANyJn81W/uTuDd1drmuACez34ESkGV1VKsQtxo=; 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=rCEELQ10cAEaYFE3jTuOOYH4NFcDNsZP5Kog6izu/lA=; b=Hrn32vCKOZ487Fts+Osp9J+0gG Avao5y53WvDtL5TtIT4vRfrOQKgMPohXcdFmJD7+Iiw1e+kqSOJeXBQQVXYxhIYn+MGdXFFVnzmxq rvssUtUeCseMDvjVcJHEgs5qqn/DCFhFqm7ppUWtYtY2xiEYfGipHTYJi8Kis3SQbht4=; 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 1jjCSh-001ZpG-HW for linux-f2fs-devel@lists.sourceforge.net; Thu, 11 Jun 2020 01:57:00 +0000 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 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-Disposition: inline In-Reply-To: X-Headers-End: 1jjCSh-001ZpG-HW Subject: Re: [f2fs-dev] [PATCH] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl 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: Daeho Jeong , kernel-team@android.com, linux-kernel@vger.kernel.org, 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 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 _______________________________________________ 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 B2519C433E0 for ; Thu, 11 Jun 2020 01:56:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E42E2074B for ; Thu, 11 Jun 2020 01:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591840615; bh=beGVc6bpHeiEA8//p9B6LnBQfT/NH139uiChyIVI8JM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=bZAlH/yVadBoJ6Yd7xrD78XVIVQon2Oh1A3g87uknX6anPHJRv6O8+QU88tuhvhsH cF3Ns2a43M6QBQ6mUe6/rH7Yftk0LKHn8mqMC0wg5EOuhZyoLmEg1BJsDV9uJAEJOq LQWBYb1xlOzOcTOnucM6A0LMSTh2DOD8RWkBf/YA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726419AbgFKB4x (ORCPT ); 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