• R/O
  • HTTP
  • SSH
  • HTTPS

linux-2.4.36: コミット

2.4.36-stable kernel tree


コミットメタ情報

リビジョンfe07ebe07a96e9e8b7cdf742779a726e169bbb15 (tree)
日時2007-06-06 15:24:30
作者Willy Tarreau <w@1wt....>
コミッターWilly Tarreau

ログメッセージ

[PATCH] lvm: update to latest fixes from the LVM package

greg@enjellic.com suggested to apply the recommended patches from
the LVM package, as every LVM user will have to generate them and
apply them anyway. Heinz Mauelshagen agreed, except for the list_del
chunk in the snapshot code which was identified as responsible for
oopses encountered in RHEL3.

Now with this patch in 2.4, it should be safe(r) to not apply the
LVM patches anymore.

変更サマリ

差分

--- a/drivers/md/lvm-internal.h
+++ b/drivers/md/lvm-internal.h
@@ -45,6 +45,7 @@ extern int loadtime;
4545 extern const char *const lvm_name;
4646
4747
48+extern uint vg_count;
4849 extern vg_t *vg[];
4950 extern struct file_operations lvm_chr_fops;
5051
--- a/drivers/md/lvm-snap.c
+++ b/drivers/md/lvm-snap.c
@@ -547,15 +547,17 @@ int lvm_snapshot_alloc_hash_table(lv_t * lv)
547547
548548 int lvm_snapshot_alloc(lv_t * lv_snap)
549549 {
550- int ret;
550+ int ret, max_sectors;
551551
552552 /* allocate kiovec to do chunk io */
553553 ret = alloc_kiovec(1, &lv_snap->lv_iobuf);
554554 if (ret)
555555 goto out;
556556
557- ret = lvm_snapshot_alloc_iobuf_pages(lv_snap->lv_iobuf,
558- KIO_MAX_SECTORS);
557+ max_sectors = KIO_MAX_SECTORS << (PAGE_SHIFT - 9);
558+
559+ ret =
560+ lvm_snapshot_alloc_iobuf_pages(lv_snap->lv_iobuf, max_sectors);
559561 if (ret)
560562 goto out_free_kiovec;
561563
--- a/drivers/md/lvm.c
+++ b/drivers/md/lvm.c
@@ -1584,10 +1584,8 @@ static int lvm_do_vg_create(void *arg, int minor)
15841584 minor = vg_ptr->vg_number;
15851585
15861586 /* check limits */
1587- if (minor >= ABS_MAX_VG) {
1588- kfree(vg_ptr);
1587+ if (minor >= ABS_MAX_VG)
15891588 return -EFAULT;
1590- }
15911589
15921590 /* Validate it */
15931591 if (vg[VG_CHR(minor)] != NULL) {
@@ -1655,7 +1653,8 @@ static int lvm_do_vg_create(void *arg, int minor)
16551653 P_IOCTL
16561654 ("ERROR: copying LV ptr %p (%d bytes)\n",
16571655 lvp, sizeof(lv_t));
1658- goto copy_fault;
1656+ lvm_do_vg_remove(minor);
1657+ return -EFAULT;
16591658 }
16601659 if (lv.lv_access & LV_SNAPSHOT) {
16611660 snap_lv_ptr[ls] = lvp;
@@ -1666,7 +1665,8 @@ static int lvm_do_vg_create(void *arg, int minor)
16661665 vg_ptr->lv[l] = NULL;
16671666 /* only create original logical volumes for now */
16681667 if (lvm_do_lv_create(minor, lv.lv_name, &lv) != 0) {
1669- goto copy_fault;
1668+ lvm_do_vg_remove(minor);
1669+ return -EFAULT;
16701670 }
16711671 }
16721672 }
@@ -1676,10 +1676,12 @@ static int lvm_do_vg_create(void *arg, int minor)
16761676 for (l = 0; l < ls; l++) {
16771677 lv_t *lvp = snap_lv_ptr[l];
16781678 if (copy_from_user(&lv, lvp, sizeof(lv_t)) != 0) {
1679- goto copy_fault;
1679+ lvm_do_vg_remove(minor);
1680+ return -EFAULT;
16801681 }
16811682 if (lvm_do_lv_create(minor, lv.lv_name, &lv) != 0) {
1682- goto copy_fault;
1683+ lvm_do_vg_remove(minor);
1684+ return -EFAULT;
16831685 }
16841686 }
16851687
@@ -1694,10 +1696,6 @@ static int lvm_do_vg_create(void *arg, int minor)
16941696 vg_ptr->vg_status |= VG_ACTIVE;
16951697
16961698 return 0;
1697-copy_fault:
1698- lvm_do_vg_remove(minor);
1699- vfree(snap_lv_ptr);
1700- return -EFAULT;
17011699 } /* lvm_do_vg_create() */
17021700
17031701
@@ -2689,10 +2687,6 @@ static int lvm_do_lv_status_byname(vg_t * vg_ptr, void *arg)
26892687 (&lv_status_byname_req.lv->lv_current_pe,
26902688 &saved_ptr1, sizeof(void *)) != 0)
26912689 return -EFAULT;
2692- if (copy_to_user
2693- (&lv_status_byname_req.lv->lv_block_exception,
2694- &saved_ptr2, sizeof(void *)) != 0)
2695- return -EFAULT;
26962690 return 0;
26972691 }
26982692 }
@@ -2747,10 +2741,6 @@ static int lvm_do_lv_status_byindex(vg_t * vg_ptr, void *arg)
27472741 (&lv_status_byindex_req.lv->lv_current_pe, &saved_ptr1,
27482742 sizeof(void *)) != 0)
27492743 return -EFAULT;
2750- if (copy_to_user
2751- (&lv_status_byindex_req.lv->lv_block_exception, &saved_ptr2,
2752- sizeof(void *)) != 0)
2753- return -EFAULT;
27542744
27552745 return 0;
27562746 } /* lvm_do_lv_status_byindex() */
@@ -2809,10 +2799,6 @@ static int lvm_do_lv_status_bydev(vg_t * vg_ptr, void *arg)
28092799 (&lv_status_bydev_req.lv->lv_current_pe, &saved_ptr1,
28102800 sizeof(void *)) != 0)
28112801 return -EFAULT;
2812- if (copy_to_user
2813- (&lv_status_bydev_req.lv->lv_block_exception, &saved_ptr2,
2814- sizeof(void *)) != 0)
2815- return -EFAULT;
28162802
28172803 return 0;
28182804 } /* lvm_do_lv_status_bydev() */
旧リポジトリブラウザで表示