From: Eric Sandeen <sandeen@redhat.com>
To: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH, RFC] check for frozen filesystems in the mmap path
Date: Thu, 16 Apr 2009 18:45:39 -0500 [thread overview]
Message-ID: <49E7C323.9040805@redhat.com> (raw)
Stephen Tweedie mentioned to me a concern that while a filesystem
is frozen, data could be dirtied for it via mmap, thereby using
up enough memory that the unfreeze process may be stuck trying
to allocate memory by writing back mmap-dirty data to the frozen
fs.
Christoph suggested maybe a check_frozen in the mmap path to
prevent this; does the sort of thing below look sane?
signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
Index: linux-2.6/mm/memory.c
===================================================================
--- linux-2.6.orig/mm/memory.c
+++ linux-2.6/mm/memory.c
@@ -1944,6 +1944,7 @@ static int do_wp_page(struct mm_struct *
* read-only shared pages can get COWed by
* get_user_pages(.write=1, .force=1).
*/
+ vfs_check_frozen(old_page->mapping->host->i_sb, SB_FREEZE_WRITE);
if (vma->vm_ops && vma->vm_ops->page_mkwrite) {
struct vm_fault vmf;
int tmp;
@@ -2660,6 +2661,7 @@ static int __do_fault(struct mm_struct *
* address space wants to know that the page is about
* to become writable
*/
+ vfs_check_frozen(vmf.page->mapping->host->i_sb, SB_FREEZE_WRITE);
if (vma->vm_ops->page_mkwrite) {
int tmp;
next reply other threads:[~2009-04-16 23:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-16 23:45 Eric Sandeen [this message]
2009-04-20 14:55 ` [PATCH, RFC] check for frozen filesystems in the mmap path Rik van Riel
2009-04-21 5:11 ` KOSAKI Motohiro
2009-04-21 15:15 ` Eric Sandeen
2009-04-22 1:35 ` KOSAKI Motohiro
2009-04-22 4:49 ` KOSAKI Motohiro
2009-04-22 5:01 ` Eric Sandeen
2009-04-22 5:29 ` KOSAKI Motohiro
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=49E7C323.9040805@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-fsdevel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).