ffs_syncvnode: only clear IN_NEEDSYNC after successfull sync
If it is cleaned before the sync, other threads might see the inode without the flag set, because syncing could unlock it. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
89fd61d955
commit
1de1e2bfbf
@ -257,7 +257,6 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags)
|
||||
bool still_dirty, unlocked, wait;
|
||||
|
||||
ip = VTOI(vp);
|
||||
ip->i_flag &= ~IN_NEEDSYNC;
|
||||
bo = &vp->v_bufobj;
|
||||
ump = VFSTOUFS(vp->v_mount);
|
||||
|
||||
@ -445,6 +444,8 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags)
|
||||
}
|
||||
if (error == 0 && unlocked)
|
||||
error = ERELOOKUP;
|
||||
if (error == 0)
|
||||
ip->i_flag &= ~IN_NEEDSYNC;
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user