[<prev] [next>] [day] [month] [year] [list]
Message-ID: <af3ea28a0707190301l5d8a801aj260a259a08360de1@mail.gmail.com>
Date: Thu, 19 Jul 2007 18:01:52 +0800
From: "ye janboe" <janboe.ye@...il.com>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: dwmw2@...radead.org, jffs-dev@...s.com
Subject: jffs2 statfs issue
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists