From: KOSAKI Motohiro Subject: Re: [PATCH, RFC] check for frozen filesystems in the mmap path Date: Tue, 21 Apr 2009 14:11:45 +0900 (JST) Message-ID: <20090421140045.F125.A69D9226@jp.fujitsu.com> References: <49E7C323.9040805@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Cc: kosaki.motohiro@jp.fujitsu.com, linux-fsdevel , Linux Kernel Mailing List To: Eric Sandeen Return-path: In-Reply-To: <49E7C323.9040805@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org > 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; it seems strage. 1. it seems to have a race CPU0 CPU1 ---------------------------------------------------- do_wp_page vfs_check_frozen ioctl_fsfreeze freeze_bdev __fsync_super process touch mem vfs_check_frozen only wait to unfreeze, but not prevent new new freeze request starting. 2. this logic kill multi thread application. this logic mean mmap_sem grabbing until unfreeze. it mean othrer thread in the same process can't page-fault although it don't touch frozen-sb. it seems strange.