The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrey Savochkin <saw@saw.sw.com.sg>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: EXT3: problem with copy_from_user inside a transaction
Date: Fri, 3 Sep 2004 15:05:21 +0400	[thread overview]
Message-ID: <20040903150521.B1834@castle.nmd.msu.ru> (raw)

Hi Andrew,

filemap_copy_from_user() between prepare_write() and commit_write()
appears to be a problem for ext3.

prepare_write() starts a transaction, and if filemap_copy_from_user() causes
a page fault, we'll have
 - order violation with mmap_sem taken inside a transaction (possible
   deadlocks),
 - __GFP_FS memory allocation with all re-entrancy problems (e.g.,
   current->journal_info corruption).

Am I missing something?

If this observation is correct, the possible solution is to call
get_user_pages() or somehow pin the user pages before prepare_write(),
although it will hurt performance...

	Andrey

             reply	other threads:[~2004-09-03 11:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-03 11:05 Andrey Savochkin [this message]
2004-09-03 12:35 ` EXT3: problem with copy_from_user inside a transaction 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
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=20040903150521.B1834@castle.nmd.msu.ru \
    --to=saw@saw.sw.com.sg \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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