Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3029947rwb; Mon, 15 Aug 2022 16:28:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR6jUBbZwqfiHVMChsnDxBz4ROK+T8bFKR1/VdLPW6boSivdf+PfR3fbJYx1PTKBECuq4cz2 X-Received: by 2002:a05:6402:5002:b0:444:26fd:d341 with SMTP id p2-20020a056402500200b0044426fdd341mr831351eda.351.1660606133661; Mon, 15 Aug 2022 16:28:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660606133; cv=none; d=google.com; s=arc-20160816; b=hwJMB0JEMho4rdmKO6R5ZH6nfn1AlLiRmwu0EkuWe+cnpyszIyxz7VslAVvFDPgRYX lf09iQEC3rDOqezLnE/hJgdmlXtMZqDjWQpkGnaNvTW5hqI6EdHKbyx8vw/ryxCgb8JH 0yNZGgIsp6ccU0/xm1x4Yf+39s0rBObWdSf32CKK+ll2ZeTRjrgtEPeFbPdIsv8CfcV+ ktLIt2tmGBa8TIZiHA3/tz0OCLROQi01gu0csYMcVdg0X5pccD9TzItDtcrhuFJw4mYr FV6o1f9uxO/2HBwfJKdzmRR/HOiZ1ThUjIzpmIEV/49obwBaOUN+7WRGzflExMGSFGnp dC3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=l//boAjjhnrr+tAFzR5B0SaQFz5SJzN4U5T0rUy1y8Q=; b=ie5FWn+8RfIyl9a8Wkx0YMobTitW4en9DSUq3nA+Wn6SgnEuy6sMJhJwGYOmO8qjWS 1TFUpgNCZjrUEcDrx5FBMH+feIBzm5TJmZJyjp2TIGnC0pZASRCcUG/eR2LJD9tFeOhX FbcUUi1pe7jWlVbn4pFXzv/0H9pQteGcky8o5nEdYz8SqGNiClZ9wed84rSHrI8QCCz7 1Vl7aNopAptBReeThDA9WyeyCm9qDZuDIl9HsxP+XCiGtzRxhmovF8VCsW4i+uiZ29BH Xm4k+9lTCfiYeNpKBX+14u99Qeh364TUGTLUlI5YA+C+hpeGH+R6b9Z5u4VLOX+JnVJw 8bNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BmU2Yz8W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020aa7c707000000b0043e62aa41c5si7870903edq.616.2022.08.15.16.28.24; Mon, 15 Aug 2022 16:28:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BmU2Yz8W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240439AbiHOXSA (ORCPT + 99 others); Mon, 15 Aug 2022 19:18:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245760AbiHOXO1 (ORCPT ); Mon, 15 Aug 2022 19:14:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC0267B780; Mon, 15 Aug 2022 13:01:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 43EB1612D1; Mon, 15 Aug 2022 20:01:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C75BC433D6; Mon, 15 Aug 2022 20:01:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593695; bh=JhNnQOE20HwpMMsPZPM6nzXHWRTIUJpndBIUOobfnog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BmU2Yz8W+Me6c2tZg5vGzW7bvNVaNm7AP6EFw+PpPjCfUjMnuf+bAAwibbA8TMP93 +v3wmoRqq/weV/bxHE88m2Wab0Gy6uCdz4uNJqfzlBdfJOdsk50jwePwJgrCL+0eeI Un4PHoQiBgd3gvnUKpLZgJQ+Z7xL0lJII6DgL6k8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sungjong Seo , Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 5.18 0954/1095] f2fs: allow compression for mmap files in compress_mode=user Date: Mon, 15 Aug 2022 20:05:53 +0200 Message-Id: <20220815180508.570829193@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sungjong Seo [ Upstream commit 66d34fcbbe63ebd8584b792e0d741f6648100894 ] Since commit e3c548323d32 ("f2fs: let's allow compression for mmap files"), it has been allowed to compress mmap files. However, in compress_mode=user, it is not allowed yet. To keep the same concept in both compress_modes, f2fs_ioc_(de)compress_file() should also allow it. Let's remove checking mmap files in f2fs_ioc_(de)compress_file() so that the compression for mmap files is also allowed in compress_mode=user. Signed-off-by: Sungjong Seo Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/file.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 863518695ea6..9a676ea080e4 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3914,11 +3914,6 @@ static int f2fs_ioc_decompress_file(struct file *filp, unsigned long arg) goto out; } - if (f2fs_is_mmap_file(inode)) { - ret = -EBUSY; - goto out; - } - ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX); if (ret) goto out; @@ -3986,11 +3981,6 @@ static int f2fs_ioc_compress_file(struct file *filp, unsigned long arg) goto out; } - if (f2fs_is_mmap_file(inode)) { - ret = -EBUSY; - goto out; - } - ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX); if (ret) goto out; -- 2.35.1