]> Pileus Git - ~andy/linux/commit
[GFS2] Fix bz 231380, unlock page before dequeing glocks in gfs2_commit_write
authorJosef Whiter <jwhiter@redhat.com>
Mon, 12 Mar 2007 21:55:07 +0000 (16:55 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Tue, 1 May 2007 08:10:37 +0000 (09:10 +0100)
commit1de913909263ba7f7054debeda1b79771a7233db
tree050e17a500f4dbe0d4d56e1b25af8243d5fe6ab8
parent89adc934f3f96600e7f31447426c7e99d62c5460
[GFS2] Fix bz 231380, unlock page before dequeing glocks in gfs2_commit_write

If we are writing a file, and in the middle of writing the file
another node attempts to get a shared lock on that file (by doing a du for
example) the process doing the writing will hang waiting on lock_page.  The
reason for this is because when we have waiters on a exclusive glock, we will go
through and flush out all dirty pages associated with that inode and release the
lock.  The problem is that when we flush the dirty pages, we could hit a page
that we have locked durring the generic_file_buffered_write part of this
operation.  This patch unlocks the page before we go to dequeue the lock and
locks it immediatly afterwards, since generic_file_buffered_write needs the page
locked when the commit_write is completed.  This patch resolves the problem,
however if somebody sees a better way to do this please don't hesistate to yell.

Signed-off-by: Josef Whiter <jwhiter@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/ops_address.c