diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_ioctl.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index d681e34c2950..5e999680094a 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c | |||
@@ -422,9 +422,12 @@ xfs_attrlist_by_handle( | |||
422 | if (IS_ERR(dentry)) | 422 | if (IS_ERR(dentry)) |
423 | return PTR_ERR(dentry); | 423 | return PTR_ERR(dentry); |
424 | 424 | ||
425 | kbuf = kzalloc(al_hreq.buflen, GFP_KERNEL); | 425 | kbuf = kmem_zalloc(al_hreq.buflen, KM_SLEEP | KM_MAYFAIL); |
426 | if (!kbuf) | 426 | if (!kbuf) { |
427 | goto out_dput; | 427 | kbuf = kmem_zalloc_large(al_hreq.buflen); |
428 | if (!kbuf) | ||
429 | goto out_dput; | ||
430 | } | ||
428 | 431 | ||
429 | cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; | 432 | cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; |
430 | error = -xfs_attr_list(XFS_I(dentry->d_inode), kbuf, al_hreq.buflen, | 433 | error = -xfs_attr_list(XFS_I(dentry->d_inode), kbuf, al_hreq.buflen, |
@@ -436,7 +439,10 @@ xfs_attrlist_by_handle( | |||
436 | error = -EFAULT; | 439 | error = -EFAULT; |
437 | 440 | ||
438 | out_kfree: | 441 | out_kfree: |
439 | kfree(kbuf); | 442 | if (is_vmalloc_addr(kbuf)) |
443 | kmem_free_large(kbuf); | ||
444 | else | ||
445 | kmem_free(kbuf); | ||
440 | out_dput: | 446 | out_dput: |
441 | dput(dentry); | 447 | dput(dentry); |
442 | return error; | 448 | return error; |