mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Alexander Belyakov <abelyako@googlemail.com>
Cc: "kernel list" <linux-kernel@vger.kernel.org>,
	linux-mtd@lists.infradead.org,
	"David Woodhouse" <dwmw2@infradead.org>,
	"Jörn Engel" <joern@logfs.org>
Subject: Re: jffs2: -ENOSPC when truncating file?!
Date: Mon, 3 Mar 2008 13:15:11 +0100	[thread overview]
Message-ID: <20080303121510.GD28369@elf.ucw.cz> (raw)
In-Reply-To: <fe810cf0802242348w625a7e7bj1a5476d6c79662@mail.gmail.com>

Hi!

> >  I'm trying to free space by truncating big file, and I get:
> >
> >  root@fic-gta01:~# ls -al gps.nmea
> >  -rw-r--r--    1 root     root      2332070 Feb 19 22:13 gps.nmea
> >  root@fic-gta01:~# > gps.nmea
> >  -sh: cannot create gps.nmea: No space left on device
> >  root@fic-gta01:~# rm gps.nmea
> >  root@fic-gta01:~# > gps.nmea
> >  root@fic-gta01:~#
> >
> >  :-(
> >
> >  Kernel is not-so-ancient, on openmoko:
> 
> Hi!
> 
> JFFS2 has known bug in GC leading to -ENOSPC upon file removal. Time
> ago I've sent a patch with detailed explanations of what is going on.
> Probably your case is the same.
> 
> Here is the patch
> http://lists.infradead.org/pipermail/linux-mtd/2007-December/020091.html
> (though infradead mailing list archive is missing most of messages
> from this thread)
> 
> And here are some details
> http://lists.infradead.org/pipermail/linux-mtd/2007-June/018756.html

Patch is here (I whitespace-damaged it, sorry], and I've seen no
discussion.. should it just be applied?
								Pavel

diff -uNr a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
--- a/fs/jffs2/wbuf.c	2007-05-25 01:22:47.000000000 +0400
+++ b/fs/jffs2/wbuf.c	2007-06-20 18:45:09.000000000 +0400
@@ -117,7 +117,7 @@

 		D1(printk(KERN_DEBUG "Removing eraseblock at 0x%08x
from erasable_pending_wbuf_list...\n", jeb->offset));
 		list_del(this);
-		if ((jiffies + (n++)) & 127) {
+		if (((jiffies + (n++)) & 127) &&
!list_empty(&c->erasable_list)) {
 			/* Most of the time, we just erase it immediately. Otherwise we
 			   spend ages scanning it on mount, etc. */
 			D1(printk(KERN_DEBUG "...and adding to
erase_pending_list\n"));



-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2008-03-03 14:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-23 23:57 Pavel Machek
2008-02-24  0:36 ` David Woodhouse
2008-02-24  6:57   ` Jörn Engel
2008-02-24 10:57     ` David Woodhouse
2008-02-24 11:08       ` Jörn Engel
2008-02-24 19:02       ` Pavel Machek
2008-02-24  7:24   ` Pavel Machek
2008-02-24 16:11     ` Jamie Lokier
2008-02-25  7:48 ` Alexander Belyakov
2008-03-03 12:15   ` Pavel Machek [this message]
2008-03-03 15:10     ` Jörn Engel
2008-03-03 16:09     ` Alexander Belyakov

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=20080303121510.GD28369@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=abelyako@googlemail.com \
    --cc=dwmw2@infradead.org \
    --cc=joern@logfs.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®