mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Tomas <alex@clusterfs.com>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@osdl.org>,
	pbadari@us.ibm.com, linux-kernel@vger.kernel.org,
	ext2-devel@lists.sourceforge.net, alex@clusterfs.com
Subject: Re: ext3 reservation question.
Date: Fri, 23 Apr 2004 09:22:55 +0400	[thread overview]
Message-ID: <m365bre09c.fsf@bzzz.home.net> (raw)
In-Reply-To: <20040421204036.4e530732.akpm@osdl.org>

>>>>> Andrew Morton (AM) writes:

 AM> That worked fine on ext2.  But on ext3 we have a transaction open in
 AM> prepare_write(), and the forced writeback will cause arbitrary amounts of
 AM> unexpected metadata to be pumped into the current transaction, causing the
 AM> fs to explode.

why to open transaction for ->prepare_write()? as for me, it doesn't
touch metadata to be stored on a disk.

I've partial implemented following idea:

->prepare_write() recognizes are blocks being written holes or reserved.
  it they are holes and haven't reserved yet, then set a flag about this.
  note that ->prepare_write() doesn't look right place to put reservation
  in because copy_from_user() in generic_file_aio_write_nolock() may fail.

->commit_write() looks at that flag and if it's set tries to reserve blocks.
  if reservation fails then ->commit_write() returns -ENOSPC, ext3_file_write()
  recognizes this, requests flushing and wait for free space.

->invalidatepage() drops reservation if space for page still non-allocated

->writepages() and ->writepage() drop reservation upon real allocation

I expect data=ordered mode to be very simple to implement: just put bio
submited in ->writepages() on list for correspondend transaction and
wait for completion of bio's in commit_transaction().

does this all make sense?

thanks, Alex


      parent reply	other threads:[~2004-04-23  5:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-21 23:55 Badari Pulavarty
2004-04-22  1:08 ` Andrew Morton
2004-04-22  3:05 ` Linus Torvalds
2004-04-22  3:40   ` Andrew Morton
2004-04-22 13:43     ` Chris Mason
2004-04-23  5:22     ` Alex Tomas [this message]

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=m365bre09c.fsf@bzzz.home.net \
    --to=alex@clusterfs.com \
    --cc=ext2-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    --cc=torvalds@osdl.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®