public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: David Woodhouse <dwmw2@infradead.org>,
	linux-mtd@lists.infradead.org,
	kernel list <linux-kernel@vger.kernel.org>
Subject: Re: jffs2: -ENOSPC when truncating file?!
Date: Sun, 24 Feb 2008 16:11:35 +0000	[thread overview]
Message-ID: <20080224161135.GA4918@shareable.org> (raw)
In-Reply-To: <20080224072423.GF2202@elf.ucw.cz>

Pavel Machek wrote:
> > You need to write a log entry indicating the new length of the file.
> > There is no space for new log entries.
> > 
> > There is a special case for removal -- 'rm gps.nmea' would work. Perhaps
> > we should add a special case for truncation too, so that it can also use
> > the extra pool of free space.
> 
> Yes, that would be nice. I somehow assumed that truncate can't fail
> for -ENOSPC ... I was trying to actually free some space on the
> filesystem...

Same here!  When I got ENOSPC from truncate, trying to free some
space, I was so surprised (and a bit disappointed) that I assumed
removal could fail too.  So now I'm pleasantly surprised to learn I
can at least remove a file.

It does seem odd that truncate to zero length can fail.  It is
guaranteed to free up one or more data nodes, so there should be
enough space for the size change node, provided GC is invoked when
necessary and the node sizes are compatible for this in corner cases.

-- Jamie

  reply	other threads:[~2008-02-24 18:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-23 23:57 jffs2: -ENOSPC when truncating file?! 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 [this message]
2008-02-25  7:48 ` Alexander Belyakov
2008-03-03 12:15   ` Pavel Machek
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=20080224161135.GA4918@shareable.org \
    --to=jamie@shareable.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=pavel@ucw.cz \
    /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