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=-7.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 BE8BBC433E2 for ; Mon, 31 Aug 2020 06:06:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5B8620707 for ; Mon, 31 Aug 2020 06:06:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726048AbgHaGGu (ORCPT ); Mon, 31 Aug 2020 02:06:50 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:10350 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725794AbgHaGGu (ORCPT ); Mon, 31 Aug 2020 02:06:50 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 3C9F8B21441495282C45; Mon, 31 Aug 2020 14:06:48 +0800 (CST) Received: from [10.136.114.67] (10.136.114.67) by smtp.huawei.com (10.3.19.202) with Microsoft SMTP Server (TLS) id 14.3.487.0; Mon, 31 Aug 2020 14:06:46 +0800 Subject: Re: [f2fs-dev] [PATCH] f2fs: prevent compressed file from being disabled after releasing cblocks To: Daeho Jeong CC: Chao Yu , Daeho Jeong , , , References: <20200828054629.583577-1-daeho43@gmail.com> <61996dcd-6db1-13fc-8239-7e684f3ec49e@kernel.org> From: Chao Yu Message-ID: <78ffaf17-56a0-32bd-0bcf-212333b52f06@huawei.com> Date: Mon, 31 Aug 2020 14:06:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.136.114.67] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/8/31 11:55, Daeho Jeong wrote: >> - open(O_RDWR) >> - ioctl(FS_IOC_SETFLAGS, F2FS_COMPR_FL) >> - write() >> - ioctl(RELEASE_COMPRESS_BLOCKS) -- inode is immutable now >> - ioctl(FS_IOC_SETFLAGS, ~F2FS_COMPR_FL) -- Should we allow to update immutable inode? >> as we know, normally, immutable inode should deny open(O_WRONLY or O_RDWR) and later update. >> > > For this case, with this patch we'll return -EINVAL for > ioctl(FS_IOC_SETFLAGS, ~F2FS_COMPR_FL). > I thought RESERVE_COMPRESS_BLOCKS ioctl is always required to get the > file to normal mode after RELEASE_COMPRESS_BLOCKS is called. That's an example, after compressed block release, shouldn't we disallow other ioctl interface which updates immutable inode? > . >