From: <ha...@no...> - 2002-05-10 12:56:54
|
In your last email, you already commented version of the patch which I am yet going to write in this email :-) Good. Reverse-engineering your comment: Yet better way to fix autofs probably is to do just one change to fs/autofs/autofs_i.h: static inline int autofs_oz_mode(struct autofs_sb_info *sbi) { /* return sbi->catatonic || current->pgrp == sbi->oz_pgrp; * Changed to let it work with bproc (should there be any): */ return sbi->catatonic || sys_getpgrp() == sbi->oz_pgrp; } This should fix autofs with bproc but also compile and work without bproc. sys_getpgrp() either contains current->pgrp in vanilla kernel or bproc hook in bproc-patched kernel. Regards Vaclav > From: Erik Arjan Hendriks <er...@he...> > To: ha...@no... > Cc: bpr...@li..., be...@be... > Date: Thu, 9 May 2002 13:14:36 -0600 > User-Agent: Mutt/1.2.5.1i > > On Thu, May 09, 2002 at 08:19:07PM +0200, ha...@no... wrote: > > ... > > #include <asm/uaccess.h> > > > > /* Added by VH for bproc: */ > > #include <linux/bproc.h> > > ... > > > > static inline int autofs_oz_mode(struct autofs_sb_info *sbi) { > > /* return sbi->catatonic || current->pgrp == sbi->oz_pgrp; > > * Changed by Vaclav Hanzl to let it work with bproc: > > */ > > return sbi->catatonic || > > bproc_hook_imv(current->pgrp,sys_getpgrp,()) == sbi->oz_pgrp; > > } > > > > I have little idea what it actually means, but it works :) > > Any comments welcome, as always. > > That calls: (kernel/sys.c from Linux source) > > asmlinkage long sys_getpgrp(void) > { > /* SMP - assuming writes are word atomic this is fine */ > return bproc_hook_imv(current->pgrp,sys_getpgrp,()); > } > > the bproc_hook_imv macro calls: (kernel/hooks.c from BProc source) > > int bproc_hook_sys_getpgrp(void) { > return current->bproc.masq->pgrp; > } > > ... but only if the caller has masqueraded PIDs which is exactly what > you want. This patch should perfectly safe. It's small and to the > point - I like it. > ... |