diff options
author | tegge <tegge@FreeBSD.org> | 2006-09-26 04:17:17 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2006-09-26 04:17:17 +0000 |
commit | 431fd40aef7a0cbbc5403ac5789a600591395339 (patch) | |
tree | 250fd2d7484ac9440b47b976cfa44dbdb1040bfd /sys | |
parent | f42473d76b149849661d41c1f44a36dd01096d40 (diff) | |
download | FreeBSD-src-431fd40aef7a0cbbc5403ac5789a600591395339.zip FreeBSD-src-431fd40aef7a0cbbc5403ac5789a600591395339.tar.gz |
Increase mnt_noasync once in softdep_mount() to disallow async io,
closing a window where a file system using softupdates could be async
for a short while if both MNT_UPDATE and MNT_ASYNC were passed as flags
to nmount(). Add MNTK_SOFTDEP flag to ensure that softdep_mount()
doesn't increase mnt_noasync multiple times.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/mount.h | 1 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 70e5097..16ea687 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -305,6 +305,7 @@ void __mnt_vnode_markerfree(struct vnode **mvp, struct mount *mp); */ #define MNTK_UNMOUNTF 0x00000001 /* forced unmount in progress */ #define MNTK_ASYNC 0x00000002 /* filtered async flag */ +#define MNTK_SOFTDEP 0x00000004 /* async disabled by softdep */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ #define MNTK_SUSPEND 0x08000000 /* request write suspension */ diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 6805563..b1a11be 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1426,6 +1426,11 @@ softdep_mount(devvp, mp, fs, cred) MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_ASYNC; mp->mnt_flag |= MNT_SOFTDEP; + if ((mp->mnt_kern_flag & MNTK_SOFTDEP) == 0) { + mp->mnt_kern_flag = (mp->mnt_kern_flag & ~MNTK_ASYNC) | + MNTK_SOFTDEP; + mp->mnt_noasync++; + } MNT_IUNLOCK(mp); ump = VFSTOUFS(mp); LIST_INIT(&ump->softdep_workitem_pending); |