From: Andrey Savochkin <saw@saw.sw.com.sg>
To: Chris Mason <mason@suse.com>
Cc: Andrea Arcangeli <andrea@suse.de>, Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: EXT3: problem with copy_from_user inside a transaction
Date: Sun, 5 Sep 2004 00:12:06 +0400 [thread overview]
Message-ID: <20040905001206.A32505@castle.nmd.msu.ru> (raw)
In-Reply-To: <20040904183333.A26720@castle.nmd.msu.ru>; from "Andrey Savochkin" on Sat, Sep 04, 2004 at 06:33:33PM
On Sat, Sep 04, 2004 at 06:33:33PM +0400, Andrey Savochkin wrote:
> On Sat, Sep 04, 2004 at 03:47:44AM -0400, Chris Mason wrote:
> > On Fri, 2004-09-03 at 09:57, Andrey Savochkin wrote:
> > > What is the problem -ENOSPC?
> > > Do you think about the problem of the page existing before this write, it's
> > > content overwritten, but the filesystem being unable to commit that write
> > > because it needs more space?
> >
> > Exactly. In this case, we've effectively corrupted the page cache.
> > We've copied data in that isn't (and never will be) reflected on disk.
> > It isn't a horribly difficult case, we just need to overwrite the data
> > with zeros, making sure to only overwrite the data corresponding to the
> > -ENOSPC error.
>
> Zeroing not mapped buffers in case of error is not difficult, indeed.
>
> I was speaking about the following case:
> - one page of a file is dirtied through a userspace mapping,
> - the page doesn't have disk mapping yet (a hole),
> - someone issues write() to this page,
> - the space allocation fails in commit_write(), when the page content has
> already been overwritten with the new data.
After some thought, we can check if the page is not completely mapped to disk
and there is a possibility that it's referenced from pte's.
In this case we can "commit" the old content in prepare_write(), allocating
space and instantiating holes...
Any better ideas?
Andrey
next prev parent reply other threads:[~2004-09-04 20:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-03 11:05 Andrey Savochkin
2004-09-03 12:35 ` Andrea Arcangeli
2004-09-03 12:06 ` Chris Mason
2004-09-03 13:03 ` Andrea Arcangeli
2004-09-03 13:57 ` Andrey Savochkin
2004-09-04 7:47 ` Chris Mason
2004-09-04 14:33 ` Andrey Savochkin
2004-09-04 20:12 ` Andrey Savochkin [this message]
2004-09-07 11:55 ` [RFC][PATCH] " Andrey Savochkin
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=20040905001206.A32505@castle.nmd.msu.ru \
--to=saw@saw.sw.com.sg \
--cc=akpm@osdl.org \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mason@suse.com \
/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®