* jffs2 statfs issue
@ 2007-07-19 10:01 ye janboe
0 siblings, 0 replies; only message in thread
From: ye janboe @ 2007-07-19 10:01 UTC (permalink / raw)
To: linux-kernel; +Cc: dwmw2, jffs-dev
jffs2 can not return correct free space amount.
I checked jffs2_statfs, there is problem.
avail = c->dirty_size + c->free_size;
if (avail > c->sector_size * c->resv_blocks_write)
avail -= c->sector_size * c->resv_blocks_write;
else
avail = 0;
But in jffs2_reserve_space, c->dirty_size will compare to
c->nospc_dirty_size. If dirty < c->nospc_dirty_size, it will return
nospace error.
So I change above code to
dirty = c->dirty_size + c->erasing_size - c->nr_erasing_blocks *
c->sector_size + c->unchecked_size;
if (dirty > c->nospc_dirty_size)
avail = c->dirty_size + c->free_size - c->nospc_dirty_size;
else
avail = c->free_size;
Do this make sense?
Thanks a lot!
Janboe
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-07-19 10:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-19 10:01 jffs2 statfs issue ye janboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®