ntfs3: change to non-blocking allocation in ntfs_d_hash
PATCH 1/1 ntfs3: change to non-blocking allocation in ntfs_d_hash
d_hash is done while under "rcu-walk" and should not sleep. __get_name() allocates using GFP_KERNEL, having the possibility to sleep when under memory pressure. Change the allocation to GFP_NOWAIT.
Reported-by [email protected]
Fixes d392e85fd1e8 ("fs/ntfs3: Fix the format of the "nocase" mount option")
Signed-off-by Diogo Jahchan Koike <[email protected]>
--- fs/ntfs3/namei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ntfs3/namei.c +2 -2
@@ -395,7 +395,7 @@ static int ntfs_d_hash(const struct dentry *dentry, struct qstr *name)/* * Try slow way with current upcase table */ - uni =__getname (); + uni =kmem_cache_alloc (names_cachep,GFP_NOWAIT );if (!uni)return -ENOMEM ;
@@ -417,7 +417,7 @@ static int ntfs_d_hash(const struct dentry *dentry, struct qstr *name) err =0 ; out: -__putname (uni); +kmem_cache_free (names_cachep, uni);return err; }
Signature · 1 line
2.43.0