diff mbox series

btrfs: remove redundant clear NODISCARD

Message ID 73233a37a2e5ce11f8eff689c9f2eef4d8fcbee0.1677745385.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs: remove redundant clear NODISCARD | expand

Commit Message

Anand Jain March 2, 2023, 1:30 p.m. UTC
If no discard mount option is specified, including the NODISCARD option,
we make the async discard the default option then we don't have to call
the clear_opt again to clear the NODISCARD flag.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/disk-io.c | 1 -
 1 file changed, 1 deletion(-)

Comments

David Sterba March 6, 2023, 6:58 p.m. UTC | #1
On Thu, Mar 02, 2023 at 09:30:48PM +0800, Anand Jain wrote:
> If no discard mount option is specified, including the NODISCARD option,
> we make the async discard the default option then we don't have to call
> the clear_opt again to clear the NODISCARD flag.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

This is maybe 3rd time somebody points out the redundant clearing of the
discard flags so I'll apply the patch. Thanks.
diff mbox series

Patch

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 5d86daa5d685..9d656eba7ce1 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3675,7 +3675,6 @@  int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
 	    fs_info->fs_devices->discardable) {
 		btrfs_set_and_info(fs_info, DISCARD_ASYNC,
 				   "auto enabling async discard");
-		btrfs_clear_opt(fs_info->mount_opt, NODISCARD);
 	}
 
 #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY