Hello, Following Tao Peng's recommendation (see below), please find attached a patch for Lustre's staging driver. Best regards, Cédric Dufour -------- Original Message -------- Subject: RE: PATCH: lustre: fix quotactl permission denied (LU-4530) Date: Fri, 24 Jan 2014 09:03:02 +0000 From: Peng, Tao <tao.peng@xxxxxxx> To: Cédric Dufour - Idiap Research Institute <cedric.dufour@xxxxxxxx>, Greg Kroah-Hartman <greg@xxxxxxxxx>, Andreas Dilger <andreas.dilger@xxxxxxxxx> CC: hpdd-discuss <hpdd-discuss@xxxxxxxxxxx>, Roland Fehrenbacher <rf@xxxxxxxxx> > -----Original Message----- > From: Cédric Dufour - Idiap Research Institute [mailto:cedric.dufour@xxxxxxxx] > Sent: Friday, January 24, 2014 4:41 PM > To: Greg Kroah-Hartman; Andreas Dilger; Peng, Tao > Cc: hpdd-discuss; Roland Fehrenbacher > Subject: PATCH: lustre: fix quotactl permission denied (LU-4530) > > Hello, > > As detailed in https://jira.hpdd.intel.com/browse/LU-4530, the changes > introduced in https://lkml.org/lkml/2013/7/15/218 (-> commit 4b1a25f0) > got the "uid_eq" check the wrong way around, leading to "Permission > denied" when a regular user attempts to retrieve his quota (lfs quota -u > ...) but allowing him to retrieve other users quota. > > Please find attached the 1-line patch that corrects this issue. > Thanks for catching the bug. This needs to go to stable as well. So please add Cc : stable@xxxxxxxxxxxxxxx [since v3.12] Thanks, Tao > Thank for your consideration and best regards, > > Cédric Dufour > > PS: It's the first time I'm doing this exercise, so please forgive and > do not hesitate to correct my errors. > > -- > > Cédric Dufour @ Idiap Research Institute > EPFL Engineer > > E-mail: cedric.dufour@xxxxxxxx <mailto:cedric.dufour@xxxxxxxx> > Phone: +41 27 721 77 40 > Fax: +41 27 721 77 12 > Mail: Idiap Research Institute > Case postale 592 > Centre du Parc - Rue Marconi 19 > 1920 Martigny (VS) > Suisse (Switzerland) > Website: www.idiap.ch <http://www.idiap.ch> / www.idiap.ch/~cdufour > <http://www.idiap.ch/%7Ecdufour>
commit ab33bb4180eb9fc0ab9885e3cf551368eb344b19 Author: Cédric Dufour <cedric.dufour@xxxxxxxx> Date: Thu Jan 23 11:19:17 2014 +0100 lustre: fix quotactl permission denied (LU-4530) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 22d0acc9..52b7731 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1086,7 +1086,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl) break; case Q_GETQUOTA: if (((type == USRQUOTA && - uid_eq(current_euid(), make_kuid(&init_user_ns, id))) || + !uid_eq(current_euid(), make_kuid(&init_user_ns, id))) || (type == GRPQUOTA && !in_egroup_p(make_kgid(&init_user_ns, id)))) && (!cfs_capable(CFS_CAP_SYS_ADMIN) ||