namei() in sys_open() breaking umount?

From: Stefan.Ludwig@gmx.net
Date: Fri Sep 29 2000 - 04:44:54 EST


This has been done using a kernel module under 2.2.13:

After modifying sys_open() by prepending a namei(filename),
all devices mounted while the modified sys_open is in place,
report an EBUSY when trying to umount them. Doesn't matter if sys_open
has been restored to the original before umount.

Code snipped: (remaining code is like in syscall.c from LKMPG 1.1.0)

asmlinkage int my_sys_open(const char *filename, int flags, int mode)
{
  struct dentry *d_entry=NULL;

  lock_kernel();
  d_entry=namei(filename);
  unlock_kernel();
  if (IS_ERR(d_entry))
     return orig_sys_open(filename, flags, mode);
  
  if (d_entry->d_inode)
     printk("<1> device=%d\n",MAJOR(d_entry->d_inode->i_dev));

  return orig_sys_open(filename, flags, mode);
}

I would be very grateful if someone could point out to me where the
problem is - and tell me how to solve it :-)

Sorry if this is a really stupid question - but I couldn't find any
relevant
information myself.

Thank you
Stefan

-- 
Sent through GMX FreeMail - http://www.gmx.net

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



This archive was generated by hypermail 2b29 : Sat Sep 30 2000 - 21:00:24 EST