From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Peterson Date: Tue, 08 May 2007 09:17:44 -0500 Subject: [Cluster-devel] [PATCH] GFS2: kernel changes to support new gfs2_grow command (Try 3) In-Reply-To: <463BAA28.7000407@redhat.com> References: <46394174.2030709@redhat.com> <20070504202317.GA16877@redhat.com> <463BAA28.7000407@redhat.com> Message-ID: <46408688.7060507@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Robert Peterson wrote: > David Teigland wrote: >> On Wed, May 02, 2007 at 08:57:08PM -0500, Robert Peterson wrote: >>> @@ -978,18 +1038,25 @@ int gfs2_inplace_reserve_i(struct gfs2_inode *ip, >> >>> - error = gfs2_rindex_hold(sdp, &al->al_ri_gh); >>> + /* We need to hold the rindex unless the inode we're using is >>> + the rindex itself, in which case it's already held. */ >>> + if (ip != GFS2_I(sdp->sd_rindex)) >>> + error = gfs2_rindex_hold(sdp, &al->al_ri_gh); >>> + else if (!sdp->sd_rgrps) /* We may not have the rindex read in, >>> so: */ >>> + error = gfs2_check_rindex_version(sdp); >>> + >> >> I don't see why we need this change, the original looks correct. > > If we're updating through the meta_fs, the rindex file will already be > glocked and held through its inode. > >> So there are the two distinct parts to the fs-grow procedure. The first >> is writing to the rindex and statfs files -- this is what was missing in >> gfs2, and I'm ignoring that part for now. >> >> The second part is gfs detecting that a grow took place and updating its >> list of rg's. I don't think this part needs any changing at all, it >> should work the same way it always has -- this is what I'm focussing on. > > I'll re-test test the original code path to make sure that this part of > the fix is still really necessary. > > Regards, > > Bob Peterson > Red Hat Cluster Suite > Hi Dave, Well, I retested this code path and found that this code is still necessary (unless I should somehow be doing this a different way). Without the code, the gfs2_rindex_hold tries to add a holder, but there's already a holder due to the meta_fs. Under the right conditions, you get: original: gfs2_prepare_write+0x49/0x237 [gfs2] new: gfs2_rindex_hold+0x2b/0x52a [gfs2] ------------[ cut here ]------------ kernel BUG at fs/gfs2/glock.c:1057! invalid opcode: 0000 [#1] SMP Modules linked in: lock_dlm gfs2 dlm configfs sd_mod sg qla2xxx CPU: 0 EIP: 0060:[] Not tainted VLI EFLAGS: 00010282 (2.6.21 #2) EIP is at gfs2_glock_nq+0xff/0x1a6 [gfs2] eax: 00000020 ebx: c3070b54 ecx: 00000046 edx: 00000046 esi: c3070c2c edi: d5147b1c ebp: d5147b1c esp: d18f7bf0 ds: 007b es: 007b fs: 00d8 gs: 0033 ss: 0068 Process gfs2_grow (pid: 5762, ti=d18f6000 task=df6e9ab0 task.ti=d18f6000) Stack: e02b8e4e 00000002 00000001 c8ba1000 00000000 c8ba1000 00000000 c8ba1000 c307099c e02b33f0 c3070c2c 00000000 d5147b1c c3070c98 def5eeb8 d521d108 00001000 c3070c2c d18f7c6c c307099c d18f7cbc e029a2c1 d18f7c6c 00000000 Call Trace: [] gfs2_rindex_hold+0x34/0x52a [gfs2] [] gfs2_block_map+0x39f/0x3ab [gfs2] [] __sched_text_start+0x715/0x7c4 [] gfs2_extent_map+0x68/0x9c [gfs2] [] gfs2_inplace_reserve_i+0x7b/0x418 [gfs2] [] gfs2_write_alloc_required+0x192/0x1ce [gfs2] [] gfs2_prepare_write+0x12d/0x237 [gfs2] [] gfs2_prepare_write+0x0/0x237 [gfs2] [] generic_file_buffered_write+0x25b/0x60f [] __mark_inode_dirty+0xdd/0x15c [] current_fs_time+0x41/0x46 [] __generic_file_aio_write_nolock+0x4e7/0x560 [] get_page_from_freelist+0x24f/0x2cf [] generic_file_aio_write+0x55/0xb3 [] do_sync_write+0xc7/0x10a [] gfs2_holder_uninit+0xb/0x1b [gfs2] [] autoremove_wake_function+0x0/0x35 [] gfs2_holder_uninit+0xb/0x1b [gfs2] [] gfs2_llseek+0x76/0x9a [gfs2] [] do_sync_write+0x0/0x10a [] vfs_write+0x8a/0x10c [] sys_write+0x41/0x67 [] sysenter_past_esp+0x5d/0x81 [] svc_defer+0x6b/0x126 ======================= Regards, Bob Peterson Red Hat Cluster Suite