Skip to contentSkip to conversation

Linux 2.4.13-ac7 missing/wrong methods

linux-lvm Goetz Bock 2 participants 2 messages Nov 4, 2001 – Nov 5, 2001

lore
Share & tools
lore

Goetz Bock

author
#0 lore raw

Hi,

after I'v just installed a new server with Linux 2.4.13-ac7 and LVM 1.0.1-rc4, I'd just wanted to tell you (dear list) that there are two missing symbols in lvm-snap.c

I've used vanila 2.4.13 applied the ac7 patch, the 2.4.11-vfs... patch and the LVM patch generated by today (as of about 12:00 GMT) CVS version.

Patching and comiling worked flawlessly (except for the known bug of patching Makefile twice and the attemp to remove the lvm-snap.h (IIRC)) but make modules_install failed whith two symbols missing.

After some reading of the code and the patches I've made the inlined patch. With it everyting works fine (well, for some reasons my initrd does not work as exspected and I will have to try again later to move to a LVM root ... (if someone should care, I've nothing but the described patches applied, but am using devfs))

---------------------------------------------------------------------------

drivers/md/lvm-snap.c +9 -6
@@ -542,9 +542,10 @@
 int lvm_snapshot_alloc(lv_t * lv_snap)
 {
 	int ret, max_sectors;
+	int nbhs = KIO_MAX_SECTORS;
 
 	/* allocate kiovec to do chunk io */
-	ret = alloc_kiovec(1, &lv_snap->lv_iobuf);
+	ret = alloc_kiovec_sz(1, &lv_snap->lv_iobuf, &nbhs);
 	if (ret) goto out;
 
 	max_sectors = KIO_MAX_SECTORS << (PAGE_SHIFT-9);
@@ -553,7 +554,7 @@
 	if (ret) goto out_free_kiovec;
 
 	/* allocate kiovec to do exception table io */
-	ret = alloc_kiovec(1, &lv_snap->lv_COW_table_iobuf);
+	ret = alloc_kiovec_sz(1, &lv_snap->lv_COW_table_iobuf, &nbhs);
 	if (ret) goto out_free_kiovec;
 
 	ret = lvm_snapshot_alloc_iobuf_pages(lv_snap->lv_COW_table_iobuf,
@@ -568,12 +569,12 @@
 
 out_free_both_kiovecs:
 	unmap_kiobuf(lv_snap->lv_COW_table_iobuf);
-	free_kiovec(1, &lv_snap->lv_COW_table_iobuf);
+	free_kiovec_sz(1, &lv_snap->lv_COW_table_iobuf, &nbhs);
 	lv_snap->lv_COW_table_iobuf = NULL;
 
 out_free_kiovec:
 	unmap_kiobuf(lv_snap->lv_iobuf);
-	free_kiovec(1, &lv_snap->lv_iobuf);
+	free_kiovec_sz(1, &lv_snap->lv_iobuf, &nbhs);
 	lv_snap->lv_iobuf = NULL;
 	vfree(lv_snap->lv_snapshot_hash_table);
 	lv_snap->lv_snapshot_hash_table = NULL;
@@ -582,6 +583,8 @@
 
 void lvm_snapshot_release(lv_t * lv)
 {
+	int 	nbhs = KIO_MAX_SECTORS;
+
 	if (lv->lv_block_exception)
 	{
 		vfree(lv->lv_block_exception);
@@ -597,14 +600,14 @@
 	{
 	        kiobuf_wait_for_io(lv->lv_iobuf);
 		unmap_kiobuf(lv->lv_iobuf);
-		free_kiovec(1, &lv->lv_iobuf);
+		free_kiovec_sz(1, &lv->lv_iobuf, &nbhs);
 		lv->lv_iobuf = NULL;
 	}
 	if (lv->lv_COW_table_iobuf)
 	{
 	        kiobuf_wait_for_io(lv->lv_COW_table_iobuf);
 		unmap_kiobuf(lv->lv_COW_table_iobuf);
-		free_kiovec(1, &lv->lv_COW_table_iobuf);
+		free_kiovec_sz(1, &lv->lv_COW_table_iobuf, &nbhs);
 		lv->lv_COW_table_iobuf = NULL;
 	}
 }

---------------------------------------------------------------------------

Signature · 2 lines
Goetz Bock                                              IT Consultant
Dipl.-Inf. Univ.
#1 lore raw
Quoted 5 lines · Goetz Bock

Hi,

after I'v just installed a new server with Linux 2.4.13-ac7 and LVM 1.0.1-rc4, I'd just wanted to tell you (dear list) that there are two missing symbols in lvm-snap.c

I see that Alan just merged the set of patches into -ac7, this means he is now *very* close to what we have in cvs. IRC all he's missing is the extra bits of checking in lvm-snap, and the optimisation that Andreas put into the hardsectsize calculation. So unless you're a heavy snapshot user, just use -ac as it comes.

BTW: if someone (Andreas ?) finds time to build a patch to update him in these two areas I'd appreciate it.

- Joe