Re: [patch-2.4.0-test5-pre1] nullfs and forced umount

From: Tigran Aivazian (tigran@veritas.com)
Date: Tue Jul 18 2000 - 13:21:23 EST


Hi Manfred,

Thank you very much for your comments - they are very useful!
Let me first address the easy ones:

> > + lock_kernel();
> > + locks_remove_posix(file, files);
> > + locks_remove_flock(file);
> > + unlock_kernel();
>
> Now superflous, locks_remove_xy calls lock_kernel internally.

Agree. Fixed now.

> > +
> > +void disable_filesystem(struct vfsmount *mnt)
> > +{
>
> Please use get_task_struct(), task_lock() and atomic_inc(ref_count).
> Your code contains the same bug as the old access_process_vm code that
> caused crashes in 2.3.51(+-2)

Ok, so the loop over tasks should look like this?

repeat:
  read_lock(&tasklist_lock);
  for_each_task(p) {
     blabla, need to block next
     task_lock(p);
     get_task_struct(p);
     task_unlock(p);
     read_unlock(&tasklist_lock);
     block and manipulate p
     goto repeat;
  }

> > + if (flags&MNT_FORCE)
> > + disable_filesystem(mnt);
> > +
> Hmmm.
> What about module unload races?

if by module you mean nullfs then there are no races. Simply because
nullfs cannot be a module.

I will address the rest of your comments soon.

Regards,
Tigran

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



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:11 EST