]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: use strndup_user in XFS_IOC_ATTRMULTI_BY_HANDLE
authorChristoph Hellwig <hch@lst.de>
Thu, 27 Feb 2020 01:30:31 +0000 (17:30 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 3 Mar 2020 04:55:52 +0000 (20:55 -0800)
commit544d77b18343c9d2f2e89684cc886c900e1166c9
treeb78179d9a41eecbe80df4ad0aeff7e136da23be5
parent35b8eedd962be866198ade2e27a23530df20f0de
xfs: use strndup_user in XFS_IOC_ATTRMULTI_BY_HANDLE

Simplify the user copy code by using strndup_user.  This means that we
now do one memory allocation per operation instead of one per ioctl,
but memory allocations are cheap compared to the actual file system
operations.  Also the error for an invalid path is now EINVAL or EFAULT
instead of the previous odd and undocumented ERANGE.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Chandan Rajendra <chandanrlinux@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_ioctl.c
fs/xfs/xfs_ioctl32.c