diff options
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
-rw-r--r-- | fs/xfs/xfs_ioctl.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 21d9c9df9fb7..668e8f4ccf5e 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c | |||
@@ -456,12 +456,9 @@ xfs_attrlist_by_handle( | |||
456 | if (IS_ERR(dentry)) | 456 | if (IS_ERR(dentry)) |
457 | return PTR_ERR(dentry); | 457 | return PTR_ERR(dentry); |
458 | 458 | ||
459 | kbuf = kmem_zalloc(al_hreq.buflen, KM_SLEEP | KM_MAYFAIL); | 459 | kbuf = kmem_zalloc_large(al_hreq.buflen, KM_SLEEP); |
460 | if (!kbuf) { | 460 | if (!kbuf) |
461 | kbuf = kmem_zalloc_large(al_hreq.buflen); | 461 | goto out_dput; |
462 | if (!kbuf) | ||
463 | goto out_dput; | ||
464 | } | ||
465 | 462 | ||
466 | cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; | 463 | cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; |
467 | error = -xfs_attr_list(XFS_I(dentry->d_inode), kbuf, al_hreq.buflen, | 464 | error = -xfs_attr_list(XFS_I(dentry->d_inode), kbuf, al_hreq.buflen, |
@@ -472,12 +469,9 @@ xfs_attrlist_by_handle( | |||
472 | if (copy_to_user(al_hreq.buffer, kbuf, al_hreq.buflen)) | 469 | if (copy_to_user(al_hreq.buffer, kbuf, al_hreq.buflen)) |
473 | error = -EFAULT; | 470 | error = -EFAULT; |
474 | 471 | ||
475 | out_kfree: | 472 | out_kfree: |
476 | if (is_vmalloc_addr(kbuf)) | 473 | kmem_free(kbuf); |
477 | kmem_free_large(kbuf); | 474 | out_dput: |
478 | else | ||
479 | kmem_free(kbuf); | ||
480 | out_dput: | ||
481 | dput(dentry); | 475 | dput(dentry); |
482 | return error; | 476 | return error; |
483 | } | 477 | } |
@@ -495,12 +489,9 @@ xfs_attrmulti_attr_get( | |||
495 | 489 | ||
496 | if (*len > XATTR_SIZE_MAX) | 490 | if (*len > XATTR_SIZE_MAX) |
497 | return EINVAL; | 491 | return EINVAL; |
498 | kbuf = kmem_zalloc(*len, KM_SLEEP | KM_MAYFAIL); | 492 | kbuf = kmem_zalloc_large(*len, KM_SLEEP); |
499 | if (!kbuf) { | 493 | if (!kbuf) |
500 | kbuf = kmem_zalloc_large(*len); | 494 | return ENOMEM; |
501 | if (!kbuf) | ||
502 | return ENOMEM; | ||
503 | } | ||
504 | 495 | ||
505 | error = xfs_attr_get(XFS_I(inode), name, kbuf, (int *)len, flags); | 496 | error = xfs_attr_get(XFS_I(inode), name, kbuf, (int *)len, flags); |
506 | if (error) | 497 | if (error) |
@@ -509,11 +500,8 @@ xfs_attrmulti_attr_get( | |||
509 | if (copy_to_user(ubuf, kbuf, *len)) | 500 | if (copy_to_user(ubuf, kbuf, *len)) |
510 | error = EFAULT; | 501 | error = EFAULT; |
511 | 502 | ||
512 | out_kfree: | 503 | out_kfree: |
513 | if (is_vmalloc_addr(kbuf)) | 504 | kmem_free(kbuf); |
514 | kmem_free_large(kbuf); | ||
515 | else | ||
516 | kmem_free(kbuf); | ||
517 | return error; | 505 | return error; |
518 | } | 506 | } |
519 | 507 | ||