1. 18 Jun, 2002 22 commits
    • Neil Brown's avatar
      [PATCH] md 22 of 22 - Generalise md sync threads · 86711d5e
      Neil Brown authored
      Previously each raid personality (Well, 1 and 5) started their
      own thread to do resync, but md.c had a single common thread to do
      reconstruct.  Apart from being untidy, this means that you cannot
      have two arrays reconstructing at the same time, though you can have
      to array resyncing at the same time..
      
      This patch changes the personalities so they don't start the resync,
      but just leave a flag to say that it is needed.
      The common thread (mdrecoveryd) now just monitors things and starts a
      separate per-array thread whenever resync or recovery (or both) is
      needed.
      When the recovery finishes, mdrecoveryd will be woken up to re-lock
      the device and activate the spares or whatever.
      
      raid1 needs to know when resync/recovery starts and ends so it can
      allocate and release resources.
      It allocated when a resync request for stripe 0 is received.
      Previously it deallocated for resync in it's own thread, and
      deallocated for recovery when the spare is made active or inactive
      (depending on success).
      
      As raid1 doesn't own a thread anymore this needed to change.  So to
      match the "alloc on 0", the md_do_resync now calls sync_request one
      last time asking to sync one block past the end.  This is a signal to
      release any resources.
      86711d5e
    • Neil Brown's avatar
      [PATCH] md 21 of 22 - Improve handling of MD super blocks · 7444c718
      Neil Brown authored
      1/ don't free the rdev->sb on an error -- it might be
         accessed again later.  Just wait for the device to be
         exported.
      2/ Change md_update_sb to __md_update_sb and have it
         clear the sb_dirty flag.
         New md_update_sb locks the device and calls __md_update_sb
         if sb_dirty.  This avoids any possbile races around
         updating the superblock
      7444c718
    • Neil Brown's avatar
      [PATCH] md 20 of 22 - Provide SMP safe locking for all_mddevs list. · f7bbc7e1
      Neil Brown authored
      Provide SMP safe locking for all_mddevs list.
      
      the all_mddevs_lock is added to protect all_mddevs and mddev_map.
      
      ITERATE_MDDEV is moved to md.c (it isn't needed elsewhere) and enhanced
      to take the lock appropriately and always have a refcount on the object
      that is given to the body of the loop.
      
      mddev_find is changed so that the structure is allocated outside a lock,
      but test-and-set is done inside the lock.
      f7bbc7e1
    • Neil Brown's avatar
      [PATCH] md 19 of 22 - Improve serialisation of md syncing · 2d35e42d
      Neil Brown authored
      If two md arrays which share real devices (i.e they each own a partition
      on some device) need to sync/reconstruct at the same time, it is much
      more efficient to have one wait while the other completes.
      
      The current code uses interruptible_sleep_on which isn't SMP safe (without the BKL).
      This patch re-does this code to make it more secure.  Even it two start simultaneously,
      one will reliably get priority, and the other wont wait for ever.
      2d35e42d
    • Neil Brown's avatar
      [PATCH] md 18 of 22 - More mddev tidyup - remove recovery_sem and resync_sem · 7145dd24
      Neil Brown authored
      More mddev tidyup - remove recovery_sem and resync_sem
      
      recovery_sem and resync_sem get replaced by careful use
      of recovery_running protected by reconfig_sem.
      
      As part of this, the creative:
      	down(&mddev->recovery_sem);
      	up(&mddev->recovery_sem);
      
      when stopping an array gets replaced by a more obvious
      
      	wait_event(resync_wait, mddev->recovery_running <= 0);
      7145dd24
    • Neil Brown's avatar
      [PATCH] md 17 of 22 - Strengthen the locking of mddev. · bc0eea33
      Neil Brown authored
      Strengthen the locking of mddev.
      
      mddev is only ever locked in md.c, so we move {,un}lock_mddev
      out of the header and into md.c, and rename to mddev_{,un}lock
      for consistancy with mddev_{get,put,find}.
      
      When building arrays (typically at boot time) we now lock, and unlock
      as it is the "right" thing to do.  The lock should never fail.
      
      When generating /proc/mdstat, we lock each array before inspecting it.
      
      In md_ioctl, we lock the mddev early and unlock at the end, rather than
      locking in two different places.
      
      In md_open we make sure we can get a lock before completing the open.  This
      ensures that we sync with do_md_stop properly.
      
      In md_do_recovery, we lock each mddev before checking it's status.
      
      md_do_recovery must unlock while recovery happens, and a do_md_stop at this
      point will deadlock when md_do_recovery tries to regain the lock.  This will be
      fixed in a later patch.
      bc0eea33
    • Neil Brown's avatar
      [PATCH] md 16 of 22 - Next small step to improved mddev management. · ee3208bf
      Neil Brown authored
      md_ioctl doesn't need to mddev_find, as the mddev must
      be in the bd_inode->u.generic_ip.  This means we don't need
      to mddev_put either.
      ee3208bf
    • Neil Brown's avatar
      [PATCH] md 15 of 22 - Get rid of kdev_to_mddev · dfdf2be0
      Neil Brown authored
      Only two users of kdev_to_mddev remain, md_release and
      md_queue_proc.
      
      For md_release we can store the mddev in the md_inode
      at md_open time so we can find it easily.
      
      For md_queue_proc, we use mddev_find because we only have the
      device number to work with.  Hopefully the ->queue function
      will get more arguements one day...
      dfdf2be0
    • Neil Brown's avatar
      [PATCH] md 14 of 22 - Second step to tidying mddev refcounts and locking · 2cf76fbf
      Neil Brown authored
      This patch gets md_open to use mddev_find instead of kdev_to_mddev, thus
      creating the mddev if necessary.
      This guarantees that md_release will be able to find an mddev to
      mddev_put.
      
      Now that we are certain of getting the refcount right at open/close time,
      we don't need the "countdev" stuff.  If START_ARRAY happens to start and
      array other than that the one that is currently opened, it won't confuse
      things at all.
      2cf76fbf
    • Neil Brown's avatar
      [PATCH] md 13 of 22 - First step to tidying mddev recounting and locking. · a9d0889a
      Neil Brown authored
      First step to tidying mddev recounting and locking.
      
      This patches introduces
        mddev_get   which incs the refcount on an mddev
        mddev_put   which decs it and, if it becomes unused, frees it
        mddev_find  which finds or allocated an mddev for a given minor
                    This is mostly the old alloc_mddev
      
      
      free_mddev no longer actually frees it.  It just disconnects all drives
      so that mddev_put will do the free.
      
      Now the test for "does an mddev exist" is not "mddev != NULL"
      but involves checking if the mddev has disks or a superblock
      attached.
      
      This makes the semantics of do_md_stop a bit cleaner.  Previously
      if do_md_stop succeed for a real stop (not a read-only stop) then
      you didn't have to unlock the mddev, otherwise you did.  Now
      you always unlock the mddev after do_md_stop.
      a9d0889a
    • Neil Brown's avatar
      [PATCH] md 12 of 22 - Remove "data" from dev_mapping and tidy up · 932db78f
      Neil Brown authored
      The mapping from minor number to mddev structure allows for a
      'data' that is never used.  This patch removes that and explicitly
      inlines some inline functions that become trivial.
      mddev_map also becomes completely local to md.c
      932db78f
    • Neil Brown's avatar
      [PATCH] md 11 of 22 - Get rid of "OUT" macro in md.c · 8892097c
      Neil Brown authored
      It doesn't really help clarity or brevity.
      8892097c
    • Neil Brown's avatar
      [PATCH] md 10 of 22 - Remove nb_dev from mddev_s · 2dc0a8b3
      Neil Brown authored
      The nb_dev field is not needed.
      Most uses are the test if it is zero or not, and they can be replaced
      by tests on the emptiness of the disks list.
      
      Other uses are for iterating through devices in numerical order and
      it makes the code clearer (IMO) to unroll the devices into an array first
      (which has to be done at some stage anyway) and then walk that array.
      
      This makes ITERATE_RDEV_ORDERED un-necessary.
      
      Also remove the "name" field which is never used.
      2dc0a8b3
    • Neil Brown's avatar
      [PATCH] md 9 of 22 - Discard functions that have been "not yet" for a long time · 3c0c2a7b
      Neil Brown authored
      Discard functions that have been "not yet" for a long time
      
      It is not clear what these should do, or if they will ever be
      needed, so let's clean them out.  They can easily be recreated
      if there is a need.
      3c0c2a7b
    • Neil Brown's avatar
      [PATCH] md 8 of 22 - Discard md_make_request in favour of per-personality make_request functions. · d2310fab
      Neil Brown authored
      As we now have per-device queues, we don't need a common make_request
      function that dispatches, we can dispatch directly.
      
      Each *_make_request function is changed to take a request_queue_t
      from which it extract the mddev that it needs, and to deduce the
      "rw" flag directly from the bio.
      d2310fab
    • Neil Brown's avatar
      [PATCH] md 7 of 22 - Use wait_event_interuptible in md_thread · 58aa897f
      Neil Brown authored
      It currently has several lines of code where one will do.
      58aa897f
    • Neil Brown's avatar
      [PATCH] md 6 of 22 - Discard "param" from mddev structure · 26d2d542
      Neil Brown authored
      It isn't needed.  Only the chunksize is used, and it
      can be found in the superblock.
      26d2d542
    • Neil Brown's avatar
      [PATCH] md 5 of 22 - Fix various list.h list related problems in md.c · d6888487
      Neil Brown authored
      Several awkard constructs could be replaced by
      list_del_init, list_for_each or list_empty.
      
      Also two bugs fixes:
       free_device_names was freeing the wrong thing
       same_set wasn't initialised.
      d6888487
    • Neil Brown's avatar
      a1b7cd07
    • Neil Brown's avatar
      [PATCH] md 3 of 22 - Remove md_maxreadahead · 7fa418f7
      Neil Brown authored
      ..as it is nolonger used.
      7fa418f7
    • Neil Brown's avatar
      [PATCH] md 2 of 22 - Make device plugging work for md/raid5 · a0edc56a
      Neil Brown authored
      We embed a request_queue_t in the mddev structure and so
      have a separate one for each mddev.
      This is used for plugging (in raid5).
      
      Given this embeded request_queue_t, md_make_request no-longer
      needs to make from device number to mddev, but can map from
      the queue to the mddev instead.
      a0edc56a
    • Neil Brown's avatar
      [PATCH] md 1 of 22 - Fix three little compile problem when md or raid5 compiled with debugging · 9beeab32
      Neil Brown authored
      md: "dev" isn't defined any more.
      raid5: must report on "bi" before reusing the variable
      raid5: buffer_head should be bio (not a debugging thing)
      9beeab32
  2. 16 Jun, 2002 5 commits
    • Linus Torvalds's avatar
      Linux kernel 2.5.22 · d9083ea2
      Linus Torvalds authored
      d9083ea2
    • Robert Love's avatar
      [PATCH] scheduler whitespace/comment merge from -ac · 48fc1713
      Robert Love authored
      Attached patch brings over the sane bits from 2.4-ac: i.e. if Linus
      merges this and Alan merges your patch minus my complaints, the two
      trees will be in sync...
      48fc1713
    • Linus Torvalds's avatar
    • Martin Dalecki's avatar
      [PATCH] 2.5.21 ide 92 · 78929a18
      Martin Dalecki authored
       - Finally unify task_in_intr and task_mulin_intr. One crucial code path less to
         watch out, but a quite dangerous step in itself. PIO reading is functional
         again. The next step will be the unification of the write path of course.
      
       - Introduce a small helper for the execution of task file commands which
         basically just send a simple command down to the drive.
      
       - Add a buffer parameter to ide_raw_taskfile allowing to unify the handling of
         ioctl and normal ide_raw_taskfile request.
      
       - Fix some small function pointer type mismatches.
      
      Apply more host chip controller clenups by Bartlomiej:
      
           - move setting drive->current_speed from *_tune_chipset()
             to ide_config_drive_speed()
      
          cmd64x.c:
      	- convert cmd64x_tuneproc() to use ata-timing library
      	- clean cmd64x_tune_chipset() and cmd680_tune_chipset()
      
          hpt366.c:
      	- remove empty timings table
      
          it8172.c:
      	- kill prototypes
      	- update to new udma_setup() scheme
      
          - misc cleanups
      78929a18
    • Linus Torvalds's avatar
      Fix smbfs debug macros · 47496445
      Linus Torvalds authored
      47496445
  3. 15 Jun, 2002 13 commits
    • Linus Torvalds's avatar
      cardbus.c: · 9f64c00f
      Linus Torvalds authored
        Set up CardBus cards correctly: initialize them fully
        before calling device_register(), and make sure to tell
        the world that it's a PCI-like bus.
      9f64c00f
    • Pavel Machek's avatar
      [PATCH] suspend-to-{ram/disk} cleanups/fixes for 2.5.21 · ef8e826c
      Pavel Machek authored
      This kills Sysrq-D support (did not work anyway, and complicated
      code).
      
      Adds resume support to i8259A (otherwise interrupts will not work
      after S3).
      
      HAVE_NEW_DEVICE_MODEL is always true in 2.5, so we should define
      it. S3 can't work properly without that. Also limit toshiba workaround
      to S1. (This hide lack of i8259A support for me).
      
      Fixes compilation, and kills <asm/suspend.h> being included
      twice with ugly hacks around.
      ef8e826c
    • William Lee Irwin III's avatar
      3f52c652
    • François Romieu's avatar
      [PATCH] 2.5.21 - hdlc drivers fixes · d5ba0bf6
      François Romieu authored
      - (leak) memory allocated in dscc4_found1() isn't freed by caller in error path.
        dscc4_free1() is now in charge of this duty.
      - (style) code factored in dscc4_remove_one after use of dscc4_free1().
      d5ba0bf6
    • François Romieu's avatar
      [PATCH] 2.5.21 - hdlc drivers fixes · ae2e9fea
      François Romieu authored
      - (compilation fix) plain old typo in struct member naming.
      ae2e9fea
    • François Romieu's avatar
      [PATCH] 2.5.21 - hdlc drivers fixes · 0d9124dc
      François Romieu authored
      - (compilation fix) missing init.h include;
      - (compilation fix) multiple pointers can't be set to NULL in one line if their
        type differ.
      0d9124dc
    • François Romieu's avatar
      [PATCH] 2.5.21 - hdlc drivers fixes · 9eccc1de
      François Romieu authored
      Courtesy of Kevin Curtis <kevin.curtis@farsite.co.uk>, posted
      on l-k the 2002/04/15.
      
      Description
      - (compilation fix) removal of deprecated fields in net_device;
      - (bug) early pci_enable_device.
      9eccc1de
    • Andries E. Brouwer's avatar
      [PATCH] SCSI stuff part 2 · 0b2c0d4f
      Andries E. Brouwer authored
      Below a patch removing the list of sense codes from usb/storage/debug.h
      since the same list is already found in scsi/constants.c.
      This also brings this list up to date with SCSI-3.
      0b2c0d4f
    • Andries E. Brouwer's avatar
      [PATCH] scsi stuff · a19bafa6
      Andries E. Brouwer authored
      The patch below cleans up some SCSI stuff.
      
      The main purpose is to avoid trying to read the partition table
      of a removable disk when the drive has told us that no media
      are present. (Right now we try to read a 4K block and fail and
      retry and fail, and give an I/O error on the first sector,
      then try to read the second sector and fail and retry ...)
      
      Unused fields  sector_bit_size  and  sector_bit_shift  in
      struct scsi_disk were removed. The field  has_part_table
      (that has nothing to do with partition tables) was
      renamed to  has_been_registered . The field  ready  was
      renamed to  media_present .
      The overly long  sd_init_onedisk()  was split up.
      
      When we notice that no media are present anymore, the
      partitions are removed from /proc/partitions, but the
      drive remains, with size 0.
      
      A future patch will remove the field  capacity  - there are
      all too many places where capacities are stored - but the
      present patch is large enough already.
      
      There is also a quite independent patch in scsi_error.c
      (yesterday someone had an infinite loop retrying to read
      bad media) - this patch honours the SCpnt->retries.
      In case you applied this already, just ignore the scsi_error.c part.
      
      Also some "Overrides for Emacs" were removed.
      a19bafa6
    • Linus Torvalds's avatar
      Merge master.kernel.org:/home/mingo/BK/linux-2.5-misc/ · 2b4b6c20
      Linus Torvalds authored
      into home.transmeta.com:/home/torvalds/v2.5/linux
      2b4b6c20
    • Ingo Molnar's avatar
    • Linus Torvalds's avatar
      Merge http://gkernel.bkbits.net/net-drivers-2.5 · 56970f58
      Linus Torvalds authored
      into home.transmeta.com:/home/torvalds/v2.5/linux
      56970f58
    • Linus Torvalds's avatar
      Merge http://gkernel.bkbits.net/irda-2.5 · 39412eff
      Linus Torvalds authored
      into home.transmeta.com:/home/torvalds/v2.5/linux
      39412eff