[Ocfs2-commits] zab commits r2661 -
branches/locking-changes/fs/ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Oct 20 18:41:21 CDT 2005
Author: zab
Signed-off-by: mfasheh
Date: 2005-10-20 18:41:19 -0500 (Thu, 20 Oct 2005)
New Revision: 2661
Modified:
branches/locking-changes/fs/ocfs2/aops.c
Log:
o be sure to unlock on readpage errors and comment
on writepage's lack of cluster locking
Signed-off-by: mfasheh
Modified: branches/locking-changes/fs/ocfs2/aops.c
===================================================================
--- branches/locking-changes/fs/ocfs2/aops.c 2005-10-17 23:17:39 UTC (rev 2660)
+++ branches/locking-changes/fs/ocfs2/aops.c 2005-10-20 23:41:19 UTC (rev 2661)
@@ -194,7 +194,7 @@
{
struct inode *inode = page->mapping->host;
loff_t start = (loff_t)page->index << PAGE_CACHE_SHIFT;
- int ret;
+ int ret, unlock = 1;
mlog_entry("(0x%p, %lu)\n", file, (page ? page->index : 0));
@@ -222,7 +222,6 @@
flush_dcache_page(page);
kunmap(page);
SetPageUptodate(page);
- unlock_page(page);
ret = 0;
goto out_alloc;
}
@@ -234,13 +233,15 @@
}
ret = block_read_full_page(page, ocfs2_get_block);
+ unlock = 0;
-
ocfs2_data_unlock(inode, 0);
out_alloc:
up_read(&OCFS2_I(inode)->ip_alloc_sem);
ocfs2_meta_unlock(inode, 0);
out:
+ if (unlock)
+ unlock_page(page);
mlog_exit(ret);
return ret;
}
@@ -248,7 +249,14 @@
/* Note: Because we don't support holes, our allocation has
* already happened (allocation writes zeros to the file data)
* so we don't have to worry about ordered writes in
- * ocfs2_writepage. */
+ * ocfs2_writepage.
+ *
+ * ->writepage is called during the process of invalidating the page cache
+ * during blocked lock processing. It can't block on any cluster locks
+ * to during block mapping. It's relying on the fact that the block
+ * mapping can't have disappeared under the dirty pages that it is
+ * being asked to write back.
+ */
static int ocfs2_writepage(struct page *page, struct writeback_control *wbc)
{
int ret;
More information about the Ocfs2-commits
mailing list