Skip to contentSkip to conversation

O_TMPFILE problem

DISCUSSION Marco Stornelli 2 participants 2 messages Jul 28, 2013 – Jul 29, 2013 VFS

lore
Share & tools
lore
#0 lore raw

Hi,

I'm doing a couple of test about O_TMPFILE on my fs. I can see that when the file is closed the blocks allocated are not freed. It happens because of i_mode, it isn't a regular file nor a directory nor a link. I added S_IFREG in my implementation of tmpfile callback when I have to call new_inode() and now it works, but am I missing something here?

Marco

reviewer
#1 lore raw
Quoted 6 lines · Marco Stornelli

I'm doing a couple of test about O_TMPFILE on my fs. I can see that when the file is closed the blocks allocated are not freed. It happens because of i_mode, it isn't a regular file nor a directory nor a link. I added S_IFREG in my implementation of tmpfile callback when I have to call new_inode() and now it works, but am I missing something here?

No, I think you are right. We need to add S_IFREG to the mode we pass to
->tmpfile().

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR