From 33eb43090dbd6aa6840eeb35c2718cfc03e6909c Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Mon, 14 May 2007 11:38:51 -0700 Subject: [PATCH] --- yaml --- r: 56996 b: refs/heads/master c: e9dfc0b2bc42761410e8db6c252c6c5889e178b8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ocfs2/aops.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index aead5d439bc1..1755743115ab 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1c1ee4c3e7e16d23166a624a132889df3c540a18 +refs/heads/master: e9dfc0b2bc42761410e8db6c252c6c5889e178b8 diff --git a/trunk/fs/ocfs2/aops.c b/trunk/fs/ocfs2/aops.c index 8e7cafb5fc6c..30306707b2ca 100644 --- a/trunk/fs/ocfs2/aops.c +++ b/trunk/fs/ocfs2/aops.c @@ -222,7 +222,10 @@ static int ocfs2_readpage(struct file *file, struct page *page) goto out; } - down_read(&OCFS2_I(inode)->ip_alloc_sem); + if (down_read_trylock(&OCFS2_I(inode)->ip_alloc_sem) == 0) { + ret = AOP_TRUNCATED_PAGE; + goto out_meta_unlock; + } /* * i_size might have just been updated as we grabed the meta lock. We @@ -258,6 +261,7 @@ static int ocfs2_readpage(struct file *file, struct page *page) ocfs2_data_unlock(inode, 0); out_alloc: up_read(&OCFS2_I(inode)->ip_alloc_sem); +out_meta_unlock: ocfs2_meta_unlock(inode, 0); out: if (unlock)