From: Artem Bityutskiy <dedekind@infradead.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [RFC] ubi: tmp hack for lstat
Date: Mon, 20 Oct 2008 08:13:57 +0300 [thread overview]
Message-ID: <1224479637.4466.55.camel@sauron> (raw)
In-Reply-To: <20081019132122.GA20282@www.tglx.de>
On Sun, 2008-10-19 at 15:21 +0200, Sebastian Andrzej Siewior wrote:
> lstat() on /dev/ubi%d_%d returns 0 in the st_size field. This hack
> allows to get the correct file size (as long as nobody updates the volume
> in the meantime).
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> I have userpsace programs which stat() the file and process the
> returned number bytes. The other work around is to copy the file
> somewhere and use this file instead of /dev/ubi.
> Artem, do you thing it is possible to implement this functionality
> properly or would it be reasonable not to use stat() at all on ubi
> volumes?
Hi,
I've tried to stat various files in my /dev/ and all of them have size
0. Why UBI should be different? 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.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
next prev parent reply other threads:[~2008-10-20 5:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-19 13:21 [RFC] ubi: tmp hack for lstat Sebastian Andrzej Siewior
2008-10-20 5:13 ` Artem Bityutskiy [this message]
2008-10-20 9:11 ` Sebastian Andrzej Siewior
2008-10-20 9:21 ` Artem Bityutskiy
2008-10-20 12:57 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1224479637.4466.55.camel@sauron \
--to=dedekind@infradead.org \
--cc=bigeasy@linutronix.de \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox