diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-07-06 17:58:03 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-07-06 17:58:03 -0400 |
commit | 29937ac6caa68d60c7f1a3e07b6137cf53e09e24 (patch) | |
tree | ace90d235f2ee44926885efeab8d6fe9761427f8 | |
parent | 71ec63c5d66b577a71910b82740751be73e81310 (diff) |
[GFS2] Fixes to scanning of glocks (again)
This really is the correct fix this time. We just ignore all
glocks associated with inodes until the inodes are pushed
from the inode cache. At that point the glocks are queued for
reclaim, so we don't need to do it here.
Also fix one or two other minor bugs.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
-rw-r--r-- | fs/gfs2/glock.c | 12 | ||||
-rw-r--r-- | fs/gfs2/inode.c | 2 | ||||
-rw-r--r-- | fs/gfs2/ops_inode.c | 1 | ||||
-rw-r--r-- | fs/gfs2/page.c | 3 |
4 files changed, 7 insertions, 11 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 7f362d0c3f7a..0381d4cc4146 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -1965,19 +1965,13 @@ static int examine_bucket(glock_examiner examiner, struct gfs2_sbd *sdp, | |||
1965 | static void scan_glock(struct gfs2_glock *gl) | 1965 | static void scan_glock(struct gfs2_glock *gl) |
1966 | { | 1966 | { |
1967 | if (gfs2_glmutex_trylock(gl)) { | 1967 | if (gfs2_glmutex_trylock(gl)) { |
1968 | if (gl->gl_ops == &gfs2_inode_glops) { | 1968 | if (gl->gl_ops == &gfs2_inode_glops) |
1969 | struct gfs2_inode *ip = gl->gl_object; | 1969 | goto out; |
1970 | if (ip == NULL) { | ||
1971 | struct gfs2_sbd *sdp = gl->gl_sbd; | ||
1972 | gfs2_assert_withdraw(sdp, gl->gl_state == LM_ST_UNLOCKED); | ||
1973 | goto out_schedule; | ||
1974 | } | ||
1975 | } | ||
1976 | if (queue_empty(gl, &gl->gl_holders) && | 1970 | if (queue_empty(gl, &gl->gl_holders) && |
1977 | gl->gl_state != LM_ST_UNLOCKED && | 1971 | gl->gl_state != LM_ST_UNLOCKED && |
1978 | demote_ok(gl)) | 1972 | demote_ok(gl)) |
1979 | goto out_schedule; | 1973 | goto out_schedule; |
1980 | 1974 | out: | |
1981 | gfs2_glmutex_unlock(gl); | 1975 | gfs2_glmutex_unlock(gl); |
1982 | } | 1976 | } |
1983 | 1977 | ||
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 6499c4f91078..f4c48395208a 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -325,6 +325,7 @@ int gfs2_change_nlink(struct gfs2_inode *ip, int diff) | |||
325 | uint32_t nlink; | 325 | uint32_t nlink; |
326 | int error; | 326 | int error; |
327 | 327 | ||
328 | BUG_ON(ip->i_di.di_nlink != ip->i_inode.i_nlink); | ||
328 | nlink = ip->i_di.di_nlink + diff; | 329 | nlink = ip->i_di.di_nlink + diff; |
329 | 330 | ||
330 | /* If we are reducing the nlink count, but the new value ends up being | 331 | /* If we are reducing the nlink count, but the new value ends up being |
@@ -341,6 +342,7 @@ int gfs2_change_nlink(struct gfs2_inode *ip, int diff) | |||
341 | 342 | ||
342 | ip->i_di.di_nlink = nlink; | 343 | ip->i_di.di_nlink = nlink; |
343 | ip->i_di.di_ctime = get_seconds(); | 344 | ip->i_di.di_ctime = get_seconds(); |
345 | ip->i_inode.i_nlink = nlink; | ||
344 | 346 | ||
345 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); | 347 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); |
346 | gfs2_dinode_out(&ip->i_di, dibh->b_data); | 348 | gfs2_dinode_out(&ip->i_di, dibh->b_data); |
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index 8895baafc640..caecafe0469b 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c | |||
@@ -250,6 +250,7 @@ out: | |||
250 | gfs2_holder_uninit(ghs + 1); | 250 | gfs2_holder_uninit(ghs + 1); |
251 | 251 | ||
252 | if (!error) { | 252 | if (!error) { |
253 | atomic_inc(&inode->i_count); | ||
253 | d_instantiate(dentry, inode); | 254 | d_instantiate(dentry, inode); |
254 | mark_inode_dirty(inode); | 255 | mark_inode_dirty(inode); |
255 | } | 256 | } |
diff --git a/fs/gfs2/page.c b/fs/gfs2/page.c index a8165a693b56..b93caf294b9f 100644 --- a/fs/gfs2/page.c +++ b/fs/gfs2/page.c | |||
@@ -256,8 +256,7 @@ void gfs2_page_add_databufs(struct gfs2_inode *ip, struct page *page, | |||
256 | struct buffer_head *bh; | 256 | struct buffer_head *bh; |
257 | unsigned int start, end; | 257 | unsigned int start, end; |
258 | 258 | ||
259 | for (bh = head, start = 0; | 259 | for (bh = head, start = 0; bh != head || !start; |
260 | bh != head || !start; | ||
261 | bh = bh->b_this_page, start = end) { | 260 | bh = bh->b_this_page, start = end) { |
262 | end = start + bsize; | 261 | end = start + bsize; |
263 | if (end <= from || start >= to) | 262 | if (end <= from || start >= to) |