Skip to contentSkip to conversation

btrfs: use GFP_KERNEL in btrfs_init_dev_replace_tgtdev

PATCH In review David Sterba 2 participants 2 messages Jun 15, 2017 Btrfs file system

lore
Share & tools
lore

David Sterba

author maintainer
#0 lore raw

PATCH 1/1 btrfs: use GFP_KERNEL in btrfs_init_dev_replace_tgtdev

The function is called from ioctl context and we don't hold any locks that take part in writeback. Right now it's only fs_info::volume_mutex.

---
 fs/btrfs/dev-replace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/dev-replace.c +1 -1
index c6cd1d599c36..f7df85509125 100644
@@ -242,7 +242,7 @@ static int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info,
 		goto error;
 	}
 
-	name = rcu_string_strdup(device_path, GFP_NOFS);
+	name = rcu_string_strdup(device_path, GFP_KERNEL);
 	if (!name) {
 		kfree(device);
 		ret = -ENOMEM;
Signature · 1 line
2.13.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · David Sterba

The function is called from ioctl context and we don't hold any locks that take part in writeback. Right now it's only fs_info::volume_mutex.

yeah volume_mutex is fine.

Quoted 19 lines
---
  fs/btrfs/dev-replace.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/dev-replace.c +1 -1
index c6cd1d599c36..f7df85509125 100644
@@ -242,7 +242,7 @@ static int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info,
  		goto error;
  	}
 
-	name = rcu_string_strdup(device_path, GFP_NOFS);
+	name = rcu_string_strdup(device_path, GFP_KERNEL);
  	if (!name) {
  		kfree(device);
  		ret = -ENOMEM;