Kernel Driver for a new file System - Pb with cp
Hi everyone,
I'm currently developing a kernel driver to manage a new filesystem type. I'm using the kernel 4.15.18 inside the Distribution Ubuntu LTS 18.04.
I have a bug that I can not solve, and hopefully you can help me.
When I copy files onto the device with the new filesystem, the copy is automatically suspended after copying 34 MB. For instance, If i copy 50 2MB files, it stops after the 17th file, and wait for something. I was not expected this behaviour, and I'm quite confusing at the time.
In the driver, I used functions generic_file_write_iter (to store data in the page system) and generic_file_fsync (to sync the data), as the ext2 module does. When I debug the driver, I see that both functions are called, but nothing is synchronized on the device. It justs stop copying, and wait for something. I see that the first 17th inodes are created, but data are not synced into the device.
I try a basic test, which is to copy only one file. Same behavior, call of generic_file_write_iter, generic_file_fsync. Nothing physically written on the device. I see the inode by calling ls. Something weird however : I remove the inode, I umount, and OMG, it sync the data ... but not the inode itself (since it has been removed by evict_inode).
dmesg is clear during the operations, I try to debug the driver with kgdboe, but no success until now.
Can somebody please give me some tricks to correct this behavior ? According to me, I expected the driver to flush the pages after taking some space (34 MB here) to store the data from the user space, then delete the pages, reallocate some pages, reiterate operations until the copy ends.
Thank you in advance.
Last edited by krystalkarma; 08-03-2019 at 01:20 PM.
|