Skip to contentSkip to conversation

Data not freed after remove?

DISCUSSION Sven Eisenberg 2 participants 3 messages Jun 1, 2016 – Jun 14, 2016 1 message not in the archive Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi MTD list

I've seen a problem on our embedded device with UBI/UBIFS. Kernel 2.6.31+UBI/UBIFS at level ~3.10.y.

In short summary what i see is:

1. Deleting a folder with a big file (680MB) in a partition of 892MB size.
2. Perform a sync.
3. Read available free space with statvfs, fails. It reports the same value as before deletion.
4. remount partition as ro, fails. But no message in dmesg.

Is there any reason/bug known that would cause this behavior? I know this can happen, when there i an open filedescriptor to the file. So i verified and this is not the case for me.

Thanks in advance, Sven Eisenberg

Signature · 12 lines
*Sven Eisenberg*

 

novero GmbH | Meesmannstr. 103 | 44807 Bochum | Germany | Amtsgericht
Bochum | HRB 16050 | Umsatzsteueridentifikationsnummer: DE 814973142 |
Geschäftsführer: Steven E. Brown, Michael Heinz Michels, Jacobus
Gerhardus du Plessis

 

A Laird business www.lairdtech.com <http://www.lairdtech.com>

A message that is not in the archive (sent off-list or not yet received): CAFLxGvxZS_aqoR059M3aE9zz+TZ-VNhh9vpMNRJYL-97ZFrgZA@mail.gmail.com

#2 lore raw

Hi Richard and all

Quoted 5 lines · Richard Weinberger

...
What is the return code of mount()?

Quoted 1 line

Is there any reason/bug known that would cause this behavior?

Quoted 7 lines

Hmm, I don't know.

Quoted 2 lines

I know this can happen, when there i an open filedescriptor to the file. So i verified and this is not the case for me.

Yes, remount can fail if the volume is busy. That's why i wonder what the return code is.

Yes the volume is busy:
mount -o remount,ro /mnt/point = -1 EBUSY (Device or resource busy)

I could not yet identify why it is in busy state.

I added some code to check for open file descriptors. I built a test application which simulates the sequence. But it runs without a problem. Can i get informations from the kernel, what file or state causes the busy state?

br, Sven Eisenberg

#3 lore raw

Sven,

Quoted 6 lines · Sven Eisenberg
Quoted 2 lines

Yes, remount can fail if the volume is busy. That's why i wonder what the return code is.

Yes the volume is busy:
mount -o remount,ro /mnt/point = -1 EBUSY (Device or resource busy)

Quoted 6 lines

I could not yet identify why it is in busy state.

I added some code to check for open file descriptors. I built a test application which simulates the sequence. But it runs without a problem. Can i get informations from the kernel, what file or state causes the busy state?

EBUSY can have many reasons. I'd guess an open file in RW mode. Did you try lsof?

Signature · 2 lines
Thanks,
//richard