LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-03-2019, 01:17 PM   #1
krystalkarma
LQ Newbie
 
Registered: Aug 2019
Posts: 6

Rep: Reputation: Disabled
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.
 
Old 08-06-2019, 01:47 PM   #2
krystalkarma
LQ Newbie
 
Registered: Aug 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
up. Do you think more information would help ?
 
Old 03-14-2020, 04:01 PM   #3
krystalkarma
LQ Newbie
 
Registered: Aug 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
Ok, it was just a problem of block mapping and how block data addresses were computed.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Starting File System .. Starting File System .. Starting File System .. Starting File rmknox Linux - Newbie 3 08-15-2010 11:30 PM
where does file system keeps file name in the file system data structure pavan.manipal Linux - Newbie 4 02-22-2010 07:38 AM
SSH working from System A to System B but not from system B to System A bala150985 Linux - Networking 15 05-23-2009 08:53 AM
How do I include my own system call in file system driver kgp Linux - Kernel 3 06-06-2007 10:41 AM
A new kernel is out! A new kernel is out! A new kernel is out! Aussie Linux - General 9 11-29-2002 08:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration