Linus,
  The following patch tidies up a few little things in md/md.c

1/ call invalidate_device() instead of 
     fsync(); invalidate_buffers().
2/ move "register_disk" out if md_init and into do_md_run so that it
  is regstered when the disk exists and not just when the driver exists.
3/ don't fsync the device after a resync completes - there is no
   point (though possibly there once was).
4/ remove a now-redundant check for "is_mounted" when stopping a
   device.  The check is being done a more effective way.

Patch agaist 2.4.6-pre8
NeilBrown



--- ./drivers/md/md.c   2001/07/01 22:54:14     1.1
+++ ./drivers/md/md.c   2001/07/01 22:58:07     1.2
@@ -1645,8 +1645,7 @@
        ITERATE_RDEV(mddev,rdev,tmp) {
                if (rdev->faulty)
                        continue;
-               fsync_dev(rdev->dev);
-               invalidate_buffers(rdev->dev);
+               invalidate_device(rdev->dev, 1);
                if (get_hardsect_size(rdev->dev)
                    > md_hardsect_sizes[mdidx(mddev)]) 
                        md_hardsect_sizes[mdidx(mddev)] =
@@ -1672,7 +1671,8 @@
         * twice as large as sectors.
         */
        md_hd_struct[mdidx(mddev)].start_sect = 0;
-       md_hd_struct[mdidx(mddev)].nr_sects = md_size[mdidx(mddev)] << 1;
+       register_disk(&md_gendisk, MKDEV(MAJOR_NR,mdidx(mddev)),
+                     1, &md_fops, md_size[mdidx(mddev)]<<1);
 
        read_ahead[MD_MAJOR] = 1024;
        return (0);
@@ -1729,12 +1729,6 @@
                printk(STILL_IN_USE, mdidx(mddev));
                OUT(-EBUSY);
        }
- 
-       /* this shouldn't be needed as above would have fired */
-       if (!ro && is_mounted(dev)) {
-               printk (STILL_MOUNTED, mdidx(mddev));
-               OUT(-EBUSY);
-       }
 
        if (mddev->pers) {
                /*
@@ -1758,15 +1752,7 @@
                down(&mddev->recovery_sem);
                up(&mddev->recovery_sem);
 
-               /*
-                *  sync and invalidate buffers because we cannot kill the
-                *  main thread with valid IO transfers still around.
-                *  the kernel lock protects us from new requests being
-                *  added after invalidate_buffers().
-                */
-               fsync_dev (mddev_to_kdev(mddev));
-               fsync_dev (dev);
-               invalidate_buffers (dev);
+               invalidate_device(dev, 1);
 
                if (ro) {
                        if (mddev->ro)
@@ -3228,7 +3214,6 @@
        mddev_t *mddev2;
        unsigned int max_sectors, currspeed,
                j, window, err, serialize;
-       kdev_t read_disk = mddev_to_kdev(mddev);
        unsigned long mark[SYNC_MARKS];
        unsigned long mark_cnt[SYNC_MARKS];     
        int last_mark,m;
@@ -3361,7 +3346,6 @@
                } else
                        current->nice = -20;
        }
-       fsync_dev(read_disk);
        printk(KERN_INFO "md: md%d: sync done.\n",mdidx(mddev));
        err = 0;
        /*
@@ -3507,7 +3491,6 @@
                md_size[i] = 0;
                md_hardsect_sizes[i] = 512;
                md_maxreadahead[i] = MD_READAHEAD;
-               register_disk(&md_gendisk, MKDEV(MAJOR_NR,i), 1, &md_fops, 0);
        }
        blksize_size[MAJOR_NR] = md_blocksizes;
        blk_size[MAJOR_NR] = md_size;
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [EMAIL PROTECTED]

Reply via email to