Skip to contentSkip to conversation

hpfs_unlink() deadlock

RFC Al Viro 2 participants 2 messages Feb 24, 2016 VFS

lore
Share & tools
lore

Al Viro

author maintainer
#0 lore raw

Since "HPFS: Introduce a global mutex and lock it on every callback
from VFS" we had a deadlock in the "can't delete directory entry due to lack of space, try to truncate the sucker first" path - hpfs_lock() held through the area that contains notify_change() and hpfs_setattr() grabs it again. BKL != mutex...

We could try to deal with that, but really, why not simply fail with
-ENOSPC there? It still can happen, even after truncate, so it's not as if the userland didn't have to cope with it. And doing that would eliminate the last user of dentry_unhash(), allowing to kill that crap as well...

#1 lore raw
Quoted 10 lines · Al Viro

Since "HPFS: Introduce a global mutex and lock it on every callback
from VFS" we had a deadlock in the "can't delete directory entry due to lack of space, try to truncate the sucker first" path - hpfs_lock() held through the area that contains notify_change() and hpfs_setattr() grabs it again. BKL != mutex...

We could try to deal with that, but really, why not simply fail with
-ENOSPC there? It still can happen, even after truncate, so it's not as if the userland didn't have to cope with it. And doing that would eliminate the last user of dentry_unhash(), allowing to kill that crap as well...

Yes, I think it's better to just fail instead of truncating the file.

Mikulas