mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-30 10:44:09 +03:00
Fix GFP_KERNEL allocations flags
The kmem_vasprintf(), kmem_vsprintf(), kobj_open_file(), and vn_openat() functions should all use the kmem_flags_convert() function to generate the GFP_* flags. This ensures that they can be safely called in any context and the correct flags will be used. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #426
This commit is contained in:
@@ -80,7 +80,7 @@ kmem_vasprintf(const char *fmt, va_list ap)
|
||||
|
||||
do {
|
||||
va_copy(aq, ap);
|
||||
ptr = kvasprintf(GFP_KERNEL, fmt, aq);
|
||||
ptr = kvasprintf(kmem_flags_convert(KM_SLEEP), fmt, aq);
|
||||
va_end(aq);
|
||||
} while (ptr == NULL);
|
||||
|
||||
@@ -96,7 +96,7 @@ kmem_asprintf(const char *fmt, ...)
|
||||
|
||||
do {
|
||||
va_start(ap, fmt);
|
||||
ptr = kvasprintf(GFP_KERNEL, fmt, ap);
|
||||
ptr = kvasprintf(kmem_flags_convert(KM_SLEEP), fmt, ap);
|
||||
va_end(ap);
|
||||
} while (ptr == NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user