From patchwork Wed Jul 2 04:19:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 4463321 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EE6A2BEEAA for ; Wed, 2 Jul 2014 04:18:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CC7D202FE for ; Wed, 2 Jul 2014 04:18:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D3C83202F0 for ; Wed, 2 Jul 2014 04:18:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751243AbaGBESI (ORCPT ); Wed, 2 Jul 2014 00:18:08 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:35600 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750871AbaGBESH (ORCPT ); Wed, 2 Jul 2014 00:18:07 -0400 X-IronPort-AV: E=Sophos;i="5.00,817,1396972800"; d="scan'208";a="32717820" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 02 Jul 2014 12:15:22 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s624I3xJ022794; Wed, 2 Jul 2014 12:18:03 +0800 Received: from adam-work.lan (10.167.226.24) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Wed, 2 Jul 2014 12:18:09 +0800 From: Qu Wenruo To: CC: Eric Sandeen Subject: [PATCH v2] btrfs: fix nossd and ssd_spread mount option regression Date: Wed, 2 Jul 2014 12:19:07 +0800 Message-ID: <1404274747-20036-1-git-send-email-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.0.1 MIME-Version: 1.0 X-Originating-IP: [10.167.226.24] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Sandeen The commit 0780253 btrfs: Cleanup the btrfs_parse_options for remount. broke ssd options quite badly; it stopped making ssd_spread imply ssd, and it made "nossd" unsettable. Put things back at least as well as they were before (though ssd mount option handling is still pretty odd: Reported-by: Roman Mamedov Signed-off-by: Eric Sandeen Signed-off-by: Qu Wenruo --- v2(By Qu): Make nossd disable ssd and ssd_spread. Add notes in Documentation/btrfs.txt --- Documentation/filesystems/btrfs.txt | 3 +++ fs/btrfs/super.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt index d11cc2f..f7d0878 100644 --- a/Documentation/filesystems/btrfs.txt +++ b/Documentation/filesystems/btrfs.txt @@ -201,6 +201,9 @@ Options with (*) are default options and will not show in the mount options. of unused space, and may perform better on low-end ssds. ssd_spread implies ssd, enabling all other ssd heuristics as well. + Option nossd removes all ssd allocation heuristics, disabling + ssd_spread or ssd mount option. + subvol= Mount subvolume at rather than the root subvolume. is relative to the top level subvolume. diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 4662d92..cfe377a 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -522,10 +522,12 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) case Opt_ssd_spread: btrfs_set_and_info(root, SSD_SPREAD, "use spread ssd allocation scheme"); + btrfs_set_opt(info->mount_opt, SSD); break; case Opt_nossd: - btrfs_clear_and_info(root, NOSSD, + btrfs_set_and_info(root, NOSSD, "not using ssd allocation scheme"); + btrfs_clear_opt(info->mount_opt, SSD_SPREAD); btrfs_clear_opt(info->mount_opt, SSD); break; case Opt_barrier: