Re: [Yaffs] Yaffs rmdir behaves like rmdir -f

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Wookey
Date:  
To: yaffs
CC: yaffs
Subject: Re: [Yaffs] Yaffs rmdir behaves like rmdir -f
+++ [2009-09-02 11:16 +0200]:
> Wookey wrote:
>> We've just found that rmdir is not returning ENOTENT when asked to
>> delete a directory containign files.
>>
>> This is with kernel 2.6.29.1 on debian armel on a balloon3. (We
>> noticed because fontconfig's posinst script removes old-format cache
>> files and then uses find and rmdir to remove all the dirs that are now
>> empty. On our system it merrily removes all your fonts.
>>
>> strace shows that rmdir 'test' just does it, whereas on a normal
>> machine it return ENOTENT.
>
> I seem to recall seeing a report on this list suggesting that it removed
> the dir without deleting the files first! If that's the case it's rather
> more serious. Hopefully the fix will cover that but maybe needs checking.


Yes. I think that's exactly what's happening, because it is rmdir's
responsibility to traverse the file tree removing the sub-nodes, not
the FSes (I think?), and it doesn't get the chance if the initial
rmdir call doesn't return an error.

So, this bug is leaking storage as well as binning all your fonts.

Wookey
--
Principal hats: iEndian - Balloonboard - Toby Churchill - Emdebian
http://wookware.org/