Skip to contentSkip to conversation

btrfs: fix nossd and ssd_spread mount option regression

PATCH In review Eric Sandeen 2 participants 2 messages Jun 27, 2014 – Jun 30, 2014 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: fix nossd and ssd_spread mount option regression

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:

# mount -o "nossd,ssd_spread" works?)

---

I've tested this insofar as I was actually able to mount with nossd,and see it reflected in /proc/mounts.

If SSD_SPREAD is set, show_options() won't show you the ssd option, so that's not totally obvious. Still, this is what the code did before the regression.

fs/btrfs/super.c +2 -1
index 4662d92..0e8edcc 100644
@@ -522,9 +522,10 @@ 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);
 			break;
#1 lore raw

Oh, my bad, sorry for the SSD related mount options mess.

Thanks for the patch fixing the bug, comments inlined below. -------- Original Message --------
Subject: [PATCH] btrfs: fix nossd and ssd_spread mount option regression
From: Eric Sandeen <[email protected]>
To: linux-btrfs <[email protected]>
Date: 2014年06月28日 05:50

Quoted 27 lines

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:

# mount -o "nossd,ssd_spread" works?)

---

I've tested this insofar as I was actually able to mount with nossd,and see it reflected in /proc/mounts.

If SSD_SPREAD is set, show_options() won't show you the ssd option, so that's not totally obvious. Still, this is what the code did before the regression.

fs/btrfs/super.c +0 -0
index 4662d92..0e8edcc 100644

fs/btrfs/super.c int btrfs_parse_options(struct btrfs_root *root, char *options) · line 530

Quoted 10 lines
fs/btrfs/super.c +2 -1
@@ -522,9 +522,10 @@ 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);

Since ssd_spread implies ssd, so nossd should also clear ssd_spread. So btrfs_clear_opt(info->mount_opt, SSD_SPREAD) is also needed.

Thanks,
Qu

Quoted 6 lines
fs/btrfs/super.c +0 -1
  			break;
 
--

To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html