On 2010-01-16 at 13:24:16 [+0100], Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote: > Ingo Weinhold <ingo_weinhold@xxxxxx> wrote: > > Nope. Even back in r10 the root node reference was released > > explicitly. > > Interestingly, fat's dosfs_unmount() says: > > > > // Unlike in BeOS, we need to put the reference to our root node > > ourselves > > > > Introduced by korli in r18667, though also at that revision > > fs_unmount() > > freed all root node references itself. > > I'm pretty sure that this was my fault originally, though :-) > > > > Isn't vnode_to_be_freed() twice here for the root node? > > > It doesn't really matter, though, since nothing bad happens in > > > vnode_to_be_freed() - it just doesn't clear kFlagsHot, so the hot > > > path > > > might be walked twice. > > > I guess we should just reduce the ref before the loop, and that's > > > it? > > Mmh, I find it a bit worrisome though, that the root node is freed > > before > > the FS's unmount() hook is called. The root node is supposed to be > > still > > valid at that point. > > If that is true, we should let the file system carry the burden of > freeing the root node -- freeing the root node after unmounting doesn't > sound like a good solution either. Well, at least it would allow the FS to access the root node at that point. On the other hand I can't think of a reason why a file system would really need to access the root node at this point, though. I'm somewhat undecided. CU, Ingo