* [PATCH 1/4] btrfs: use GFP_KERNEL in create_snapshot
2017-02-13 13:50 [PATCH 0/4] More GFP_NOFS removals David Sterba
@ 2017-02-13 13:50 ` David Sterba
2017-02-13 13:50 ` [PATCH 2/4] btrfs: use GFP_KERNEL in btrfs_read_qgroup_config David Sterba
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-02-13 13:50 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
We don't need to use GFP_NOFS here as this is called from ioctls an the
only lock held is the subvol_sem, which is of a high level and protects
creation/renames/deletion and is never held in the writeout paths.
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 77f93a1e65c7..f65ace58dd2c 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -670,12 +670,12 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state))
return -EINVAL;
- pending_snapshot = kzalloc(sizeof(*pending_snapshot), GFP_NOFS);
+ pending_snapshot = kzalloc(sizeof(*pending_snapshot), GFP_KERNEL);
if (!pending_snapshot)
return -ENOMEM;
pending_snapshot->root_item = kzalloc(sizeof(struct btrfs_root_item),
- GFP_NOFS);
+ GFP_KERNEL);
pending_snapshot->path = btrfs_alloc_path();
if (!pending_snapshot->root_item || !pending_snapshot->path) {
ret = -ENOMEM;
--
2.10.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/4] btrfs: use GFP_KERNEL in btrfs_read_qgroup_config
2017-02-13 13:50 [PATCH 0/4] More GFP_NOFS removals David Sterba
2017-02-13 13:50 ` [PATCH 1/4] btrfs: use GFP_KERNEL in create_snapshot David Sterba
@ 2017-02-13 13:50 ` David Sterba
2017-02-13 13:50 ` [PATCH 3/4] btrfs: use GFP_KERNEL in btrfs_quota_enable David Sterba
2017-02-13 13:50 ` [PATCH 4/4] btrfs: use GFP_KERNEL in btrfs_add/del_qgroup_relation David Sterba
3 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-02-13 13:50 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
The qgroup config is read during mount, we do not have to use NOFS.
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/qgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 8496dbf3f38b..cdd0a16bf469 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -319,7 +319,7 @@ int btrfs_read_qgroup_config(struct btrfs_fs_info *fs_info)
if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags))
return 0;
- fs_info->qgroup_ulist = ulist_alloc(GFP_NOFS);
+ fs_info->qgroup_ulist = ulist_alloc(GFP_KERNEL);
if (!fs_info->qgroup_ulist) {
ret = -ENOMEM;
goto out;
--
2.10.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/4] btrfs: use GFP_KERNEL in btrfs_quota_enable
2017-02-13 13:50 [PATCH 0/4] More GFP_NOFS removals David Sterba
2017-02-13 13:50 ` [PATCH 1/4] btrfs: use GFP_KERNEL in create_snapshot David Sterba
2017-02-13 13:50 ` [PATCH 2/4] btrfs: use GFP_KERNEL in btrfs_read_qgroup_config David Sterba
@ 2017-02-13 13:50 ` David Sterba
2017-02-13 13:50 ` [PATCH 4/4] btrfs: use GFP_KERNEL in btrfs_add/del_qgroup_relation David Sterba
3 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-02-13 13:50 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
We don't need to use GFP_NOFS here as this is called from ioctls an the
only lock held is the subvol_sem, which is of a high level and protects
creation/renames/deletion and is never held in the writeout paths.
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/qgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index cdd0a16bf469..4759fd46cfb5 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -876,7 +876,7 @@ int btrfs_quota_enable(struct btrfs_trans_handle *trans,
goto out;
}
- fs_info->qgroup_ulist = ulist_alloc(GFP_NOFS);
+ fs_info->qgroup_ulist = ulist_alloc(GFP_KERNEL);
if (!fs_info->qgroup_ulist) {
ret = -ENOMEM;
goto out;
--
2.10.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 4/4] btrfs: use GFP_KERNEL in btrfs_add/del_qgroup_relation
2017-02-13 13:50 [PATCH 0/4] More GFP_NOFS removals David Sterba
` (2 preceding siblings ...)
2017-02-13 13:50 ` [PATCH 3/4] btrfs: use GFP_KERNEL in btrfs_quota_enable David Sterba
@ 2017-02-13 13:50 ` David Sterba
3 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2017-02-13 13:50 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Qgroup relations are added/deleted from ioctl, we hold the high level
qgroup lock, no deadlocks or recursion from the allocation possible
here.
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/qgroup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 4759fd46cfb5..d97353440a70 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1174,7 +1174,7 @@ int btrfs_add_qgroup_relation(struct btrfs_trans_handle *trans,
if (btrfs_qgroup_level(src) >= btrfs_qgroup_level(dst))
return -EINVAL;
- tmp = ulist_alloc(GFP_NOFS);
+ tmp = ulist_alloc(GFP_KERNEL);
if (!tmp)
return -ENOMEM;
@@ -1234,7 +1234,7 @@ int __del_qgroup_relation(struct btrfs_trans_handle *trans,
int ret = 0;
int err;
- tmp = ulist_alloc(GFP_NOFS);
+ tmp = ulist_alloc(GFP_KERNEL);
if (!tmp)
return -ENOMEM;
--
2.10.1
^ permalink raw reply related [flat|nested] 5+ messages in thread