Re: [PATCH] diskquota: 32bit quota tools on 64bit architectures [message #7664 is a reply to message #7646] |
Thu, 19 October 2006 17:29 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) ![Go to next message Go to previous message](/theme/ovz3/images/down.png) |
Christoph Hellwig
Messages: 59 Registered: April 2006
|
Member |
|
|
On Thu, Oct 19, 2006 at 04:32:07PM +0400, Vasily Tarasov wrote:
> +asmlinkage long sys32_quotactl(unsigned int cmd, const char __user *special,
> + qid_t id, void __user *addr)
> +{
> + long ret;
> + unsigned int cmds;
> + mm_segment_t old_fs;
> + struct if_dqblk dqblk;
> + struct if32_dqblk {
> + __u32 dqb_bhardlimit[2];
> + __u32 dqb_bsoftlimit[2];
> + __u32 dqb_curspace[2];
> + __u32 dqb_ihardlimit[2];
> + __u32 dqb_isoftlimit[2];
> + __u32 dqb_curinodes[2];
> + __u32 dqb_btime[2];
> + __u32 dqb_itime[2];
> + __u32 dqb_valid;
> + } dqblk32;
> +
> + cmds = cmd >> SUBCMDSHIFT;
> +
> + switch (cmds) {
> + case Q_GETQUOTA:
> + old_fs = get_fs();
> + set_fs(KERNEL_DS);
> + ret = sys_quotactl(cmd, special, id, &dqblk);
> + set_fs(old_fs);
Please allocate the structure using compat_alloc_userspace and copy
with copy_in_user instead of the set_fs trick.
|
|
|