diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2012-06-10 21:29:05 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2012-06-10 21:29:05 +0000 |
commit | 730441b710704e62e7888e014283f788e091236f (patch) | |
tree | a4b4ab3057f7dfeca17c8fe7948bbc3cae5baf7e /sys/ufs | |
parent | fda4d3c249ea1c9f0ca5c12242160169b0eb0300 (diff) |
Do NOT make all check condition results report EIO. Only use EIO
when b_error has not already been set to something more informative,
e.g. EROFS.
DO check the result of ffs_sbupdate() and error out of a mount()
call when ffs_sbupdate() reports EROFS while attempting a rw mount.
Letting RW mounts proceed regardless of EROFS led to crashes and
usb problems for Oliver Seufer while using the RW/RO switches on
some usb devices. Fix developed using devices kindly supplied by
Oliver & Co.
ok miod@
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 0b9fec7fd2e..619880c2803 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.133 2011/07/04 20:35:35 deraadt Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.134 2012/06/10 21:29:04 krw Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -902,7 +902,9 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p) fs->fs_flags |= FS_DOSOFTDEP; else fs->fs_flags &= ~FS_DOSOFTDEP; - (void) ffs_sbupdate(ump, MNT_WAIT); + error = ffs_sbupdate(ump, MNT_WAIT); + if (error == EROFS) + goto out; } return (0); out: |