Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys

Module Name:    src
Committed By:   ad
Date:           Tue May  6 18:43:45 UTC 2008

Modified Files:
        src/sys/coda: coda_psdev.c
        src/sys/compat/common: vfs_syscalls_20.c
        src/sys/compat/netbsd32: netbsd32_compat_20.c
        src/sys/compat/osf1: osf1_mount.c
        src/sys/compat/ultrix: ultrix_fs.c
        src/sys/fs/cd9660: cd9660_vfsops.c
        src/sys/fs/filecorefs: filecore_vfsops.c
        src/sys/fs/msdosfs: msdosfs_vfsops.c
        src/sys/fs/ntfs: ntfs_vfsops.c
        src/sys/fs/puffs: puffs_msgif.c
        src/sys/fs/union: union_vnops.c
        src/sys/kern: vfs_lookup.c vfs_subr.c vfs_subr2.c vfs_syscalls.c
        src/sys/miscfs/procfs: procfs_linux.c
        src/sys/miscfs/syncfs: sync_vnops.c
        src/sys/nfs: nfs_export.c nfs_vfsops.c
        src/sys/rump/librump/rumpkern: rump.c
        src/sys/sys: fstypes.h mount.h
        src/sys/ufs/ext2fs: ext2fs_vfsops.c
        src/sys/ufs/ffs: ffs_vfsops.c
        src/sys/ufs/lfs: lfs_bio.c lfs_syscalls.c lfs_vfsops.c
        src/sys/ufs/mfs: mfs_extern.h mfs_vfsops.c mfs_vnops.c
        src/sys/ufs/ufs: ufs_vfsops.c

Log Message:
PR kern/38141 lookup/vfs_busy acquire rwlock recursively

Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.

Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:

- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
  sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
  and is only ever write locked in dounmount(). A write hold can't be taken
  on this lock if the current LWP could hold a vnode lock.

- kmutex_t mnt_updating. This is taken by threads updating the mount, for
  example when going r/o -> r/w, and is only present to serialize updates.
  In order to take this lock, a read hold must first be taken on
  mnt_unmounting, and the two need to be held across the operation.

One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.

To generate a diff of this commit:
cvs rdiff -r1.44 -r1.45 src/sys/coda/coda_psdev.c
cvs rdiff -r1.29 -r1.30 src/sys/compat/common/vfs_syscalls_20.c
cvs rdiff -r1.23 -r1.24 src/sys/compat/netbsd32/netbsd32_compat_20.c
cvs rdiff -r1.43 -r1.44 src/sys/compat/osf1/osf1_mount.c
cvs rdiff -r1.48 -r1.49 src/sys/compat/ultrix/ultrix_fs.c
cvs rdiff -r1.60 -r1.61 src/sys/fs/cd9660/cd9660_vfsops.c
cvs rdiff -r1.51 -r1.52 src/sys/fs/filecorefs/filecore_vfsops.c
cvs rdiff -r1.64 -r1.65 src/sys/fs/msdosfs/msdosfs_vfsops.c
cvs rdiff -r1.68 -r1.69 src/sys/fs/ntfs/ntfs_vfsops.c
cvs rdiff -r1.70 -r1.71 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -r1.32 -r1.33 src/sys/fs/union/union_vnops.c
cvs rdiff -r1.107 -r1.108 src/sys/kern/vfs_lookup.c
cvs rdiff -r1.343 -r1.344 src/sys/kern/vfs_subr.c
cvs rdiff -r1.23 -r1.24 src/sys/kern/vfs_subr2.c
cvs rdiff -r1.357 -r1.358 src/sys/kern/vfs_syscalls.c
cvs rdiff -r1.52 -r1.53 src/sys/miscfs/procfs/procfs_linux.c
cvs rdiff -r1.24 -r1.25 src/sys/miscfs/syncfs/sync_vnops.c
cvs rdiff -r1.36 -r1.37 src/sys/nfs/nfs_export.c
cvs rdiff -r1.198 -r1.199 src/sys/nfs/nfs_vfsops.c
cvs rdiff -r1.44 -r1.45 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -r1.22 -r1.23 src/sys/sys/fstypes.h
cvs rdiff -r1.177 -r1.178 src/sys/sys/mount.h
cvs rdiff -r1.133 -r1.134 src/sys/ufs/ext2fs/ext2fs_vfsops.c
cvs rdiff -r1.225 -r1.226 src/sys/ufs/ffs/ffs_vfsops.c
cvs rdiff -r1.113 -r1.114 src/sys/ufs/lfs/lfs_bio.c
cvs rdiff -r1.131 -r1.132 src/sys/ufs/lfs/lfs_syscalls.c
cvs rdiff -r1.259 -r1.260 src/sys/ufs/lfs/lfs_vfsops.c
cvs rdiff -r1.28 -r1.29 src/sys/ufs/mfs/mfs_extern.h
cvs rdiff -r1.95 -r1.96 src/sys/ufs/mfs/mfs_vfsops.c
cvs rdiff -r1.49 -r1.50 src/sys/ufs/mfs/mfs_vnops.c
cvs rdiff -r1.38 -r1.39 src/sys/ufs/ufs/ufs_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Home | Main Index | Thread Index | Old Index