s390x bugfix for quotactl()

From: Jan Kara (jack@suse.cz)
Date: Mon Jul 30 2001 - 12:15:11 EST


  Hello,

  I found out that in 2.4.7 there's a bug in s390x wrapper around quotactl() call
(part of patch from -ac kernel migrated to your kernel but this part alone makes
call not even compile). Following patch should fix it.

                                                                        Honza

--------------------------------------------------------------------------------
--- linux-2.4.7/arch/s390x/kernel/linux32.c Fri Jul 27 20:57:13 2001
+++ linux-2.4.7/arch/s390x/kernel/linux32.c Fri May 11 23:18:09 2001
@@ -897,24 +897,24 @@
         return sys32_fcntl(fd, cmd, arg);
 }
 
-struct mem_dqblk32 {
+struct dqblk32 {
+ __u32 dqb_bhardlimit;
+ __u32 dqb_bsoftlimit;
+ __u32 dqb_curblocks;
     __u32 dqb_ihardlimit;
     __u32 dqb_isoftlimit;
     __u32 dqb_curinodes;
- __u32 dqb_bhardlimit;
- __u32 dqb_bsoftlimit;
- __u64 dqb_curspace;
     __kernel_time_t32 dqb_btime;
     __kernel_time_t32 dqb_itime;
 };
                                 
-extern asmlinkage long sys_quotactl(int cmd, const char *special, int id, __kernel_caddr_t addr);
+extern asmlinkage int sys_quotactl(int cmd, const char *special, int id, caddr_t addr);
 
 asmlinkage int sys32_quotactl(int cmd, const char *special, int id, unsigned long addr)
 {
         int cmds = cmd >> SUBCMDSHIFT;
         int err;
- struct mem_dqblk d;
+ struct dqblk d;
         mm_segment_t old_fs;
         char *spec;
         
@@ -924,35 +924,33 @@
         case Q_SETQUOTA:
         case Q_SETUSE:
         case Q_SETQLIM:
- if (copy_from_user (&d, (struct mem_dqblk32 *)addr,
- sizeof (struct mem_dqblk32)))
+ if (copy_from_user (&d, (struct dqblk32 *)addr,
+ sizeof (struct dqblk32)))
                         return -EFAULT;
- d.dqb_itime = ((struct mem_dqblk32 *)&d)->dqb_itime;
- d.dqb_btime = ((struct mem_dqblk32 *)&d)->dqb_btime;
+ d.dqb_itime = ((struct dqblk32 *)&d)->dqb_itime;
+ d.dqb_btime = ((struct dqblk32 *)&d)->dqb_btime;
                 break;
         default:
                 return sys_quotactl(cmd, special,
- id, (__kernel_caddr_t)addr);
+ id, (caddr_t)addr);
         }
         spec = getname (special);
         err = PTR_ERR(spec);
         if (IS_ERR(spec)) return err;
         old_fs = get_fs ();
         set_fs (KERNEL_DS);
- err = sys_quotactl(cmd, (const char *)spec, id, (__kernel_caddr_t)&d);
+ err = sys_quotactl(cmd, (const char *)spec, id, (caddr_t)&d);
         set_fs (old_fs);
         putname (spec);
- if (err)
- return err;
         if (cmds == Q_GETQUOTA) {
                 __kernel_time_t b = d.dqb_btime, i = d.dqb_itime;
- ((struct mem_dqblk32 *)&d)->dqb_itime = i;
- ((struct mem_dqblk32 *)&d)->dqb_btime = b;
- if (copy_to_user ((struct mem_dqblk32 *)addr, &d,
- sizeof (struct mem_dqblk32)))
+ ((struct dqblk32 *)&d)->dqb_itime = i;
+ ((struct dqblk32 *)&d)->dqb_btime = b;
+ if (copy_to_user ((struct dqblk32 *)addr, &d,
+ sizeof (struct dqblk32)))
                         return -EFAULT;
         }
- return 0;
+ return err;
 }
 
 static inline int put_statfs (struct statfs32 *ubuf, struct statfs *kbuf)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:44 EST