udf: Remove GFP_NOFS from dir iteration code
authorJan Kara <jack@suse.cz>
Tue, 9 Jan 2024 10:00:46 +0000 (11:00 +0100)
committerJan Kara <jack@suse.cz>
Tue, 23 Jan 2024 18:21:10 +0000 (19:21 +0100)
Directory iteration code was using GFP_NOFS allocations in two places.
However the code is called only under inode->i_rwsem which is generally
safe wrt reclaim. So we can do the allocations with GFP_KERNEL instead.

Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/dir.c
fs/udf/namei.c

index f6533f93851b959fab34927a621fb2c6f8648160..f94f45fe2c91e3f0167f36da97153f529e7de426 100644 (file)
@@ -67,7 +67,7 @@ static int udf_readdir(struct file *file, struct dir_context *ctx)
                pos_valid = true;
        }
 
-       fname = kmalloc(UDF_NAME_LEN, GFP_NOFS);
+       fname = kmalloc(UDF_NAME_LEN, GFP_KERNEL);
        if (!fname) {
                ret = -ENOMEM;
                goto out;
index 1bb6ed948927fbe5a2d4176671b00d96fa63ddc3..1f14a0621a91272151ab3a646c4ff5ff66e20ae2 100644 (file)
@@ -59,7 +59,7 @@ static int udf_fiiter_find_entry(struct inode *dir, const struct qstr *child,
                child->name[0] == '.' && child->name[1] == '.';
        int ret;
 
-       fname = kmalloc(UDF_NAME_LEN, GFP_NOFS);
+       fname = kmalloc(UDF_NAME_LEN, GFP_KERNEL);
        if (!fname)
                return -ENOMEM;