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.
This commit is contained in:
parent
f42473d76b
commit
431fd40aef
@ -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 */
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user