fishy ->put_inode usage in affs
looking at i_count in ->put_inode is racy. But ou could do the truncate nicely in ->clear_inode, with some work you might be able to consolidate the affs_truncate call in affs_delete_inode into that one aswell.
Also what's the rationale for discarding the preallocations in affs_put_inode? Inode reference counts are something purely internal, depending in whether it's in core or ondisk reservations either fops->release or iops->clear_inode sounds like the right thing for it.
Hi,
Quoted 3 lines · Christoph Hellwig
looking at
i_countin ->put_inode is racy. But ou could do the truncate nicely in ->clear_inode, with some work you might be able to consolidate theaffs_truncatecall inaffs_delete_inodeinto that one aswell.
I don't like the idea of delaying it that long. I'll probably should move it to affs_file_release() and affs_notify_change().
Quoted 4 lines
Also what's the rationale for discarding the preallocations in
affs_put_inode? Inode reference counts are something purely internal, depending in whether it's in core or ondisk reservations eitherfops->releaseoriops->clear_inodesounds like the right thing for it.
Well, the last time I did some major work on it, was somewhere during 2.2, but I guess I've put it there to make sure preallocation is released. The problem are directories, I'd like to avoid that preallocation for them is kept too long. Actually I'd like to have some mechanism to explicitly free all preallocations, e.g. when a disk gets full, it can be used to completely fill it. At some point I played around with some code to do this by basically doing a sync (that's why there is another call in affs_write_inode()).
bye, Roman