diff options
author | sandeen@sandeen.net <sandeen@sandeen.net> | 2008-11-25 22:20:06 -0500 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-12-02 01:08:01 -0500 |
commit | 743bb4650da9e2595d6cedd01c680b5b9398c74a (patch) | |
tree | d0bf4740672bdd77a7cd2dde0af7a564fcfe62d6 /fs/xfs/xfs_rtalloc.c | |
parent | 0e446673a15a4e9c336b67c1a638eb12c21d0993 (diff) |
[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>
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
-rw-r--r-- | fs/xfs/xfs_rtalloc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index f18b9b281799..edf12c7b834c 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c | |||
@@ -1876,6 +1876,8 @@ xfs_growfs_rt( | |||
1876 | /* | 1876 | /* |
1877 | * Initial error checking. | 1877 | * Initial error checking. |
1878 | */ | 1878 | */ |
1879 | if (!capable(CAP_SYS_ADMIN)) | ||
1880 | return XFS_ERROR(EPERM); | ||
1879 | if (mp->m_rtdev_targp == NULL || mp->m_rbmip == NULL || | 1881 | if (mp->m_rtdev_targp == NULL || mp->m_rbmip == NULL || |
1880 | (nrblocks = in->newblocks) <= sbp->sb_rblocks || | 1882 | (nrblocks = in->newblocks) <= sbp->sb_rblocks || |
1881 | (sbp->sb_rblocks && (in->extsize != sbp->sb_rextsize))) | 1883 | (sbp->sb_rblocks && (in->extsize != sbp->sb_rextsize))) |