OSDN Git Service

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)
commit2282a9e65177b425aaab4d8228f98f5c09fc778a
treeb78179d9a41eecbe80df4ad0aeff7e136da23be5
parent6cc4f4fff10d38e95994e740f1b1d260c6fe8506
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