[XFS] Move copy_from_user calls out of ioctl helpers into ioctl switch.
Moving the copy_from_user out of some of the ioctl helpers will make it easier for the compat ioctl switch to copy in the right struct, then just pass to the underlying helper. Also, move common access checks into the helpers themselves, and out of the native ioctl switch code, to reduce code duplication between native & compat ioctl callers. Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
This commit is contained in:
parent
0e446673a1
commit
743bb4650d
5 changed files with 63 additions and 64 deletions
|
@ -435,6 +435,9 @@ xfs_growfs_data(
|
|||
xfs_growfs_data_t *in)
|
||||
{
|
||||
int error;
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return XFS_ERROR(EPERM);
|
||||
if (!mutex_trylock(&mp->m_growlock))
|
||||
return XFS_ERROR(EWOULDBLOCK);
|
||||
error = xfs_growfs_data_private(mp, in);
|
||||
|
@ -448,6 +451,9 @@ xfs_growfs_log(
|
|||
xfs_growfs_log_t *in)
|
||||
{
|
||||
int error;
|
||||
|
||||
if (!capable(CAP_SYS_ADMIN))
|
||||
return XFS_ERROR(EPERM);
|
||||
if (!mutex_trylock(&mp->m_growlock))
|
||||
return XFS_ERROR(EWOULDBLOCK);
|
||||
error = xfs_growfs_log_private(mp, in);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue