Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38798
b: refs/heads/master
c: 166afcc
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Aug 24, 2006
1 parent 313308e commit 5f8fc43
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 233e515f4062f99569c24f00ad7429a860b23db4
refs/heads/master: 166afccd71fbb7bd758ab9fc770eef4924081077
29 changes: 14 additions & 15 deletions trunk/fs/gfs2/ops_address.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,10 @@ static void stuck_releasepage(struct buffer_head *bh)
struct gfs2_sbd *sdp = inode->i_sb->s_fs_info;
struct gfs2_bufdata *bd = bh->b_private;
struct gfs2_glock *gl;
static unsigned limit = 0;

if (limit++ > 3)
return;

fs_warn(sdp, "stuck in gfs2_releasepage() %p\n", inode);
fs_warn(sdp, "blkno = %llu, bh->b_count = %d\n",
Expand Down Expand Up @@ -736,28 +740,24 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
struct gfs2_sbd *sdp = aspace->i_sb->s_fs_info;
struct buffer_head *bh, *head;
struct gfs2_bufdata *bd;
unsigned long t;
unsigned long t = jiffies + gfs2_tune_get(sdp, gt_stall_secs) * HZ;

if (!page_has_buffers(page))
goto out;

head = bh = page_buffers(page);
do {
t = jiffies;

while (atomic_read(&bh->b_count)) {
if (atomic_read(&aspace->i_writecount)) {
if (time_after_eq(jiffies, t +
gfs2_tune_get(sdp, gt_stall_secs) * HZ)) {
stuck_releasepage(bh);
t = jiffies;
}

yield();
continue;
if (!atomic_read(&aspace->i_writecount))
return 0;

if (time_after_eq(jiffies, t)) {
stuck_releasepage(bh);
/* should we withdraw here? */
return 0;
}

return 0;
yield();
}

gfs2_assert_warn(sdp, !buffer_pinned(bh));
Expand All @@ -773,8 +773,7 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
}

bh = bh->b_this_page;
}
while (bh != head);
} while (bh != head);

out:
return try_to_free_buffers(page);
Expand Down

0 comments on commit 5f8fc43

Please sign in to comment.