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=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 45DEFC433E6 for ; Tue, 1 Sep 2020 16:54:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A01C20767 for ; Tue, 1 Sep 2020 16:54:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598979266; bh=+W9iQQDIkEYtWUq1ITmOocl10kxxbkvUppl0NQHHlos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=efCtuiv0Nmy9Qz7YSspmdzOhE3M/QA2sYFJwJqQgQ5uSpHLxi+FmcpFmF8ZxorPdd kgr2PM8eKkbxKMDAA2rLTuVeTqILzw8mgVzIB0J2doW4a+h2ECu9z95XJYhHaPFHa3 Nh0EiJJ2F5C2gUBpspt+csWTcrUwz5PuVTV7O3RY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730441AbgIAQyY (ORCPT ); Tue, 1 Sep 2020 12:54:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:48546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729259AbgIAPYj (ORCPT ); Tue, 1 Sep 2020 11:24:39 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 A911120BED; Tue, 1 Sep 2020 15:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598973879; bh=+W9iQQDIkEYtWUq1ITmOocl10kxxbkvUppl0NQHHlos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I3gRMKjqRnAl89GYo3ZZIxwTC0Ejf5ncBrWXXkXoIMea5HKTIe8lkcGv4GY+1ruk4 zNUU9CpkXwRbZIPeKJILzpON7Bcx+pKUXaO3NSX/cpYmdPxrQS6QDm7/lie/QLvzZE p+mf++SRh4tNa5WDDmH2HOJNwh6wvVeB0H1FfRq4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcos Paulo de Souza , David Sterba Subject: [PATCH 4.19 083/125] btrfs: reset compression level for lzo on remount Date: Tue, 1 Sep 2020 17:10:38 +0200 Message-Id: <20200901150938.639962714@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901150934.576210879@linuxfoundation.org> References: <20200901150934.576210879@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marcos Paulo de Souza commit 282dd7d7718444679b046b769d872b188818ca35 upstream. Currently a user can set mount "-o compress" which will set the compression algorithm to zlib, and use the default compress level for zlib (3): relatime,compress=zlib:3,space_cache If the user remounts the fs using "-o compress=lzo", then the old compress_level is used: relatime,compress=lzo:3,space_cache But lzo does not expose any tunable compression level. The same happens if we set any compress argument with different level, also with zstd. Fix this by resetting the compress_level when compress=lzo is specified. With the fix applied, lzo is shown without compress level: relatime,compress=lzo,space_cache CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Marcos Paulo de Souza Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/super.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -539,6 +539,7 @@ int btrfs_parse_options(struct btrfs_fs_ } else if (strncmp(args[0].from, "lzo", 3) == 0) { compress_type = "lzo"; info->compress_type = BTRFS_COMPRESS_LZO; + info->compress_level = 0; btrfs_set_opt(info->mount_opt, COMPRESS); btrfs_clear_opt(info->mount_opt, NODATACOW); btrfs_clear_opt(info->mount_opt, NODATASUM);