[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080311054501.GA7360@skywalker>
Date: Tue, 11 Mar 2008 11:15:01 +0530
From: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
To: Jan Kara <jack@...e.cz>
Cc: Josef Bacik <jbacik@...hat.com>, Theodore Tso <tytso@....edu>,
Andreas Dilger <adilger@....com>,
Mingming Cao <cmm@...ibm.com>,
"linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>
Subject: Re: jbd2_handle and i_data_sem circular locking dependency detected
On Mon, Mar 10, 2008 at 03:24:26PM +0100, Jan Kara wrote:
> > This one came up again when i was doing the mmap ENOSPC patch. Now the
> > current code with migrate is taking i_mutex to protech against all
> > writes. But it seems a write to a mmap area mapping a hole can still go
> > through fine. And that path cannot take i_mutex.
> >
> > So i guess the migrate locking need to be fixed. Any suggestion ?
> Hmm, thinking about it a bit more. One possibility is that we could just
> use i_mutex to protect against ordinary writes, and before swapping blocks
> for extents we'd check whether some holes were not filled in the mean time.
> If yes, we can retry the migrate, or fail it and retry later.
> Another possibility would be to make ext4 use page_mkwrite to fill in
> holes. There we could safely acquire i_mutex and be done.
>
page_mkwrite is called with mmap_sem help and we can't take inode->i_mutex
in page_mkwrite. The DIO write have inode->i_mutex -> mmap_sem
locking order.
I "fixed" it by introducing i_migrate_sem
http://article.gmane.org/gmane.comp.file-systems.ext4/5402
-aneesh
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists