Re: infinite loop in ffs_sync()
Brian Bergstrand writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
In theory, this is a bug, but in practice, it won't be a problem. This
is because all simple_lock ops are noops in all currently shipping
kernels. They are all defined out in <sys/lock.h>. I found a deadlock
in vget() over a year ago that I reported (#3193564) and it was closed
as "Behaves Correctly" for this same reason. Darwin VFS's current
position is "the funnel protects all".
Sorry, seems I was too vague in my description of what happens here. Suppose that first vnode in the mnt_vnodelist (that is mp->mnt_vnodelist.lh_first), is detached from mount-point (vp->v_mount != mp), then ffs_sync() will obviously loop indefinitely, right? The only reason I mentioned simple_lock is to indicate that other CPU cannot remove vnode from the mnt_vnodelist, hence, breaking the loop. Things remain the same even if, as you say, all VFS data are protected by the funnel.
On Jul 27, 2004, at 6:28 AM, Nikita Danilov wrote:
Hello,
xnu/bsd/ufs/ffs/ffs_vfsops.c:ffs_sync() contains
----------------------------------------------------------------------
/*
* Write back each (modified) inode.
*/
simple_lock(&mntvnode_slock);
loop:
for (vp = mp->mnt_vnodelist.lh_first;
vp != NULL;
vp = nvp) {
int didhold = 0;
/*
* If the vnode that we are about to sync is no longer
* associated with this mount point, start over.
*/
if (vp->v_mount != mp)
goto loop;
----------------------------------------------------------------------
Nikita. _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Nikita Danilov