[RFC] ubi: tmp hack for lstat
Sebastian Andrzej Siewior
bigeasy at linutronix.de
Mon Oct 20 05:11:00 EDT 2008
* Artem Bityutskiy | 2008-10-20 08:13:57 [+0300]:
>Hi,
Hi,
>I've tried to stat various files in my /dev/ and all of them have size
>0.
None of them is a file filestem so no one of them returns something.
>Why UBI should be different?
As I made the patch I though that this is the expectingt behavior.
sda/hda return 0 but those are larger then a few MiBs so you use a fs on
top. So either nobody care(s|d) or it works as expected.
>Indeed, stat should return size of the
>inode, that is normal semantics. You suggest making stat on UBI volume
>character devices return volume size. It might help your application,
>but it'll confuse other applications - for example 'du', which uses stat
>to calculate directory size. So am not sure it is good idea.
It would report the size you would get after a read(). A cp()1 on ubi
would copy the content of the node unless called with -a.
I'm actually not sure what the expected behavior is. stat() returns
information about a file and ubi isn't a regular file it is a character
node. So it would be probably better to leave everything as it and
change userspace instead.
>Best regards,
>Artem Bityutskiy (???????????????? ??????????)
Sebastian
More information about the linux-mtd
mailing list