diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-07-16 11:23:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-07-16 11:23:10 -0400 |
commit | 79140bc486fac016249f3d1d67ec9a39ebed9ad9 (patch) | |
tree | e022f9e593b48018c5ae218f5fcc364e2cacab4c | |
parent | cc10b6ffd39ef982f86de68d95e5811df82cf819 (diff) | |
parent | 728a756b8fcd22d80e2dbba8117a8a3aafd3f203 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes:
GFS2: rename causes kernel Oops
GFS2: BUG in gfs2_adjust_quota
GFS2: Fix kernel NULL pointer dereference by dlm_astd
GFS2: recovery stuck on transaction lock
GFS2: O_TRUNC not working on stuffed files across cluster
-rw-r--r-- | fs/gfs2/bmap.c | 1 | ||||
-rw-r--r-- | fs/gfs2/dir.c | 2 | ||||
-rw-r--r-- | fs/gfs2/glock.c | 10 | ||||
-rw-r--r-- | fs/gfs2/inode.c | 12 | ||||
-rw-r--r-- | fs/gfs2/quota.c | 8 |
5 files changed, 23 insertions, 10 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 4a48c0f4b402..84da64b551b2 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
@@ -1041,6 +1041,7 @@ static int trunc_start(struct gfs2_inode *ip, u64 size) | |||
1041 | 1041 | ||
1042 | if (gfs2_is_stuffed(ip)) { | 1042 | if (gfs2_is_stuffed(ip)) { |
1043 | u64 dsize = size + sizeof(struct gfs2_inode); | 1043 | u64 dsize = size + sizeof(struct gfs2_inode); |
1044 | ip->i_disksize = size; | ||
1044 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; | 1045 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; |
1045 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); | 1046 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); |
1046 | gfs2_dinode_out(ip, dibh->b_data); | 1047 | gfs2_dinode_out(ip, dibh->b_data); |
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 8295c5b5d4a9..26ca3361a8bc 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -392,7 +392,7 @@ static int gfs2_dirent_find_space(const struct gfs2_dirent *dent, | |||
392 | unsigned totlen = be16_to_cpu(dent->de_rec_len); | 392 | unsigned totlen = be16_to_cpu(dent->de_rec_len); |
393 | 393 | ||
394 | if (gfs2_dirent_sentinel(dent)) | 394 | if (gfs2_dirent_sentinel(dent)) |
395 | actual = GFS2_DIRENT_SIZE(0); | 395 | actual = 0; |
396 | if (totlen - actual >= required) | 396 | if (totlen - actual >= required) |
397 | return 1; | 397 | return 1; |
398 | return 0; | 398 | return 0; |
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index ddcdbf493536..dbab3fdc2582 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -706,8 +706,18 @@ static void glock_work_func(struct work_struct *work) | |||
706 | { | 706 | { |
707 | unsigned long delay = 0; | 707 | unsigned long delay = 0; |
708 | struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_work.work); | 708 | struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_work.work); |
709 | struct gfs2_holder *gh; | ||
709 | int drop_ref = 0; | 710 | int drop_ref = 0; |
710 | 711 | ||
712 | if (unlikely(test_bit(GLF_FROZEN, &gl->gl_flags))) { | ||
713 | spin_lock(&gl->gl_spin); | ||
714 | gh = find_first_waiter(gl); | ||
715 | if (gh && (gh->gh_flags & LM_FLAG_NOEXP) && | ||
716 | test_and_clear_bit(GLF_FROZEN, &gl->gl_flags)) | ||
717 | set_bit(GLF_REPLY_PENDING, &gl->gl_flags); | ||
718 | spin_unlock(&gl->gl_spin); | ||
719 | } | ||
720 | |||
711 | if (test_and_clear_bit(GLF_REPLY_PENDING, &gl->gl_flags)) { | 721 | if (test_and_clear_bit(GLF_REPLY_PENDING, &gl->gl_flags)) { |
712 | finish_xmote(gl, gl->gl_reply); | 722 | finish_xmote(gl, gl->gl_reply); |
713 | drop_ref = 1; | 723 | drop_ref = 1; |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index b5612cbb62a5..f03afd9c44bc 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -169,7 +169,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, | |||
169 | { | 169 | { |
170 | struct inode *inode; | 170 | struct inode *inode; |
171 | struct gfs2_inode *ip; | 171 | struct gfs2_inode *ip; |
172 | struct gfs2_glock *io_gl; | 172 | struct gfs2_glock *io_gl = NULL; |
173 | int error; | 173 | int error; |
174 | 174 | ||
175 | inode = gfs2_iget(sb, no_addr); | 175 | inode = gfs2_iget(sb, no_addr); |
@@ -198,6 +198,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, | |||
198 | ip->i_iopen_gh.gh_gl->gl_object = ip; | 198 | ip->i_iopen_gh.gh_gl->gl_object = ip; |
199 | 199 | ||
200 | gfs2_glock_put(io_gl); | 200 | gfs2_glock_put(io_gl); |
201 | io_gl = NULL; | ||
201 | 202 | ||
202 | if ((type == DT_UNKNOWN) && (no_formal_ino == 0)) | 203 | if ((type == DT_UNKNOWN) && (no_formal_ino == 0)) |
203 | goto gfs2_nfsbypass; | 204 | goto gfs2_nfsbypass; |
@@ -228,7 +229,8 @@ gfs2_nfsbypass: | |||
228 | fail_glock: | 229 | fail_glock: |
229 | gfs2_glock_dq(&ip->i_iopen_gh); | 230 | gfs2_glock_dq(&ip->i_iopen_gh); |
230 | fail_iopen: | 231 | fail_iopen: |
231 | gfs2_glock_put(io_gl); | 232 | if (io_gl) |
233 | gfs2_glock_put(io_gl); | ||
232 | fail_put: | 234 | fail_put: |
233 | if (inode->i_state & I_NEW) | 235 | if (inode->i_state & I_NEW) |
234 | ip->i_gl->gl_object = NULL; | 236 | ip->i_gl->gl_object = NULL; |
@@ -256,7 +258,7 @@ void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr) | |||
256 | { | 258 | { |
257 | struct gfs2_sbd *sdp; | 259 | struct gfs2_sbd *sdp; |
258 | struct gfs2_inode *ip; | 260 | struct gfs2_inode *ip; |
259 | struct gfs2_glock *io_gl; | 261 | struct gfs2_glock *io_gl = NULL; |
260 | int error; | 262 | int error; |
261 | struct gfs2_holder gh; | 263 | struct gfs2_holder gh; |
262 | struct inode *inode; | 264 | struct inode *inode; |
@@ -293,6 +295,7 @@ void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr) | |||
293 | 295 | ||
294 | ip->i_iopen_gh.gh_gl->gl_object = ip; | 296 | ip->i_iopen_gh.gh_gl->gl_object = ip; |
295 | gfs2_glock_put(io_gl); | 297 | gfs2_glock_put(io_gl); |
298 | io_gl = NULL; | ||
296 | 299 | ||
297 | inode->i_mode = DT2IF(DT_UNKNOWN); | 300 | inode->i_mode = DT2IF(DT_UNKNOWN); |
298 | 301 | ||
@@ -319,7 +322,8 @@ void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr) | |||
319 | fail_glock: | 322 | fail_glock: |
320 | gfs2_glock_dq(&ip->i_iopen_gh); | 323 | gfs2_glock_dq(&ip->i_iopen_gh); |
321 | fail_iopen: | 324 | fail_iopen: |
322 | gfs2_glock_put(io_gl); | 325 | if (io_gl) |
326 | gfs2_glock_put(io_gl); | ||
323 | fail_put: | 327 | fail_put: |
324 | ip->i_gl->gl_object = NULL; | 328 | ip->i_gl->gl_object = NULL; |
325 | gfs2_glock_put(ip->i_gl); | 329 | gfs2_glock_put(ip->i_gl); |
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 49667d68769e..b256d6f24288 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -694,10 +694,8 @@ get_a_page: | |||
694 | if (!buffer_mapped(bh)) | 694 | if (!buffer_mapped(bh)) |
695 | goto unlock_out; | 695 | goto unlock_out; |
696 | /* If it's a newly allocated disk block for quota, zero it */ | 696 | /* If it's a newly allocated disk block for quota, zero it */ |
697 | if (buffer_new(bh)) { | 697 | if (buffer_new(bh)) |
698 | memset(bh->b_data, 0, bh->b_size); | 698 | zero_user(page, pos - blocksize, bh->b_size); |
699 | set_buffer_uptodate(bh); | ||
700 | } | ||
701 | } | 699 | } |
702 | 700 | ||
703 | if (PageUptodate(page)) | 701 | if (PageUptodate(page)) |
@@ -723,7 +721,7 @@ get_a_page: | |||
723 | 721 | ||
724 | /* If quota straddles page boundary, we need to update the rest of the | 722 | /* If quota straddles page boundary, we need to update the rest of the |
725 | * quota at the beginning of the next page */ | 723 | * quota at the beginning of the next page */ |
726 | if (offset != 0) { /* first page, offset is closer to PAGE_CACHE_SIZE */ | 724 | if ((offset + sizeof(struct gfs2_quota)) > PAGE_CACHE_SIZE) { |
727 | ptr = ptr + nbytes; | 725 | ptr = ptr + nbytes; |
728 | nbytes = sizeof(struct gfs2_quota) - nbytes; | 726 | nbytes = sizeof(struct gfs2_quota) - nbytes; |
729 | offset = 0; | 727 | offset = 0; |