<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md/bitmap.c, branch v2.6.28</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.28</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.28'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2008-12-19T05:25:01Z</updated>
<entry>
<title>md: Don't read past end of bitmap when reading bitmap.</title>
<updated>2008-12-19T05:25:01Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2008-12-19T05:25:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a2ed9615e3222645007fc19991aedf30eed3ecfd'/>
<id>urn:sha1:a2ed9615e3222645007fc19991aedf30eed3ecfd</id>
<content type='text'>
When we read the write-intent-bitmap off the device, we currently
read a whole number of pages.
When PAGE_SIZE is 4K, this works due to the alignment we enforce
on the superblock and bitmap.
When PAGE_SIZE is 64K, this case read past the end-of-device
which causes an error.

When we write the superblock, we ensure to clip the last page
to just be the required size.  Copy that code into the read path
to just read the required number of sectors.

Signed-off-by: Neil Brown &lt;neilb@suse.de&gt;
Cc: stable@kernel.org
</content>
</entry>
<entry>
<title>Fix problem with waiting while holding rcu read lock in md/bitmap.c</title>
<updated>2008-09-01T02:48:13Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2008-09-01T02:48:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b2d2c4ceaddc3098f19637a732f74b820a81a9e7'/>
<id>urn:sha1:b2d2c4ceaddc3098f19637a732f74b820a81a9e7</id>
<content type='text'>
A recent patch to protect the rdev list with rcu locking leaves us
with a problem because we can sleep on memalloc while holding the
rcu lock.

The rcu lock is only needed while walking the linked list as
uninteresting devices (failed or spares) can be removed at any time.

So only take the rcu lock while actually walking the linked list.
Take a refcount on the rdev during the time when we drop the lock
and do the memalloc to start IO.
When we return to the locked code, all the interesting devices
on the list will not have moved, so we can simply use
list_for_each_continue_rcu to pick up where we left off.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: the bitmap code needs to use blk_plug_device_unlocked()</title>
<updated>2008-08-01T18:32:31Z</updated>
<author>
<name>Jens Axboe</name>
<email>jens.axboe@oracle.com</email>
</author>
<published>2008-08-01T18:32:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=93769f58078e2a066b56217cae1e343ac5a6b78c'/>
<id>urn:sha1:93769f58078e2a066b56217cae1e343ac5a6b78c</id>
<content type='text'>
It doesn't hold the queue lock, so it's both racey on the queue flags
and thus spews a warning.

Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>md: Protect access to mddev-&gt;disks list using RCU</title>
<updated>2008-07-21T07:05:25Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2008-07-21T07:05:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4b80991c6cb9efa607bc4fd6f3ecdf5511c31bb0'/>
<id>urn:sha1:4b80991c6cb9efa607bc4fd6f3ecdf5511c31bb0</id>
<content type='text'>
All modifications and most access to the mddev-&gt;disks list are made
under the reconfig_mutex lock.  However there are three places where
the list is walked without any locking.  If a reconfig happens at this
time, havoc (and oops) can ensue.

So use RCU to protect these accesses:
  - wrap them in rcu_read_{,un}lock()
  - use list_for_each_entry_rcu
  - add to the list with list_add_rcu
  - delete from the list with list_del_rcu
  - delay the 'free' with call_rcu rather than schedule_work

Note that export_rdev did a list_del_init on this list.  In almost all
cases the entry was not in the list anymore so it was a no-op and so
safe.  It is no longer safe as after list_del_rcu we may not touch
the list_head.
An audit shows that export_rdev is called:
  - after unbind_rdev_from_array, in which case the delete has
     already been done,
  - after bind_rdev_to_array fails, in which case the delete isn't needed.
  - before the device has been put on a list at all (e.g. in
      add_new_disk where reading the superblock fails).
  - and in autorun devices after a failure when the device is on a
      different list.

So remove the list_del_init call from export_rdev, and add it back
immediately before the called to export_rdev for that last case.

Note also that -&gt;same_set is sometimes used for lists other than
mddev-&gt;list (e.g. candidates).  In these cases rcu is not needed.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: Turn rdev-&gt;sb_offset into a sector-based quantity.</title>
<updated>2008-07-11T12:02:23Z</updated>
<author>
<name>Andre Noll</name>
<email>maan@systemlinux.org</email>
</author>
<published>2008-07-11T12:02:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0f420358e3a2abc028320ace7783e2e38cae77bf'/>
<id>urn:sha1:0f420358e3a2abc028320ace7783e2e38cae77bf</id>
<content type='text'>
Rename it to sb_start to make sure all users have been converted.

Signed-off-by: Andre Noll &lt;maan@systemlinux.org&gt;
Signed-off-by: Neil Brown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>Improve setting of "events_cleared" for write-intent bitmaps.</title>
<updated>2008-06-27T22:31:22Z</updated>
<author>
<name>Neil Brown</name>
<email>neilb@notabene.brown</email>
</author>
<published>2008-06-27T22:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a0da84f35b25875870270d16b6eccda4884d61a7'/>
<id>urn:sha1:a0da84f35b25875870270d16b6eccda4884d61a7</id>
<content type='text'>
When an array is degraded, bits in the write-intent bitmap are not
cleared, so that if the missing device is re-added, it can be synced
by only updated those parts of the device that have changed since
it was removed.

The enable this a 'events_cleared' value is stored. It is the event
counter for the array the last time that any bits were cleared.

Sometimes - if a device disappears from an array while it is 'clean' -
the events_cleared value gets updated incorrectly (there are subtle
ordering issues between updateing events in the main metadata and the
bitmap metadata) resulting in the missing device appearing to require
a full resync when it is re-added.

With this patch, we update events_cleared precisely when we are about
to clear a bit in the bitmap.  We record events_cleared when we clear
the bit internally, and copy that to the superblock which is written
out before the bit on storage.  This makes it more "obviously correct".

We also need to update events_cleared when the event_count is going
backwards (as happens on a dirty-&gt;clean transition of a non-degraded
array).

Thanks to Mike Snitzer for identifying this problem and testing early
"fixes".

Cc:  "Mike Snitzer" &lt;snitzer@gmail.com&gt;
Signed-off-by: Neil Brown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>md: kill file_path wrapper</title>
<updated>2008-05-24T16:56:09Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2008-05-23T20:04:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6bcfd601861cce45ca73ac1d714f1286b6b3f0d4'/>
<id>urn:sha1:6bcfd601861cce45ca73ac1d714f1286b6b3f0d4</id>
<content type='text'>
Kill the trivial and rather pointless file_path wrapper around d_path.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Neil Brown &lt;neilb@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>md: reduce CPU wastage on idle md array with a write-intent bitmap</title>
<updated>2008-03-11T01:01:19Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2008-03-10T18:43:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7be3dfec4724c51e890455fe48fe188ad7c18b88'/>
<id>urn:sha1:7be3dfec4724c51e890455fe48fe188ad7c18b88</id>
<content type='text'>
Recent patch titled
  Reduce CPU wastage on idle md array with a write-intent bitmap.

would sometimes leave the array with dirty bitmap bits that stay dirty.  A
subsequent write would sort things out so it isn't a big problem, but should
be fixed nonetheless.

We need to make sure that when the bitmap becomes not "allclean", the
daemon_sleep really does get set to a sensible value.

Signed-off-by: Neil Brown &lt;neilb@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>md: reduce CPU wastage on idle md array with a write-intent bitmap</title>
<updated>2008-03-05T00:35:17Z</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2008-03-04T22:29:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8311c29d40235062a843f4a8e8a70a44af6fe4c9'/>
<id>urn:sha1:8311c29d40235062a843f4a8e8a70a44af6fe4c9</id>
<content type='text'>
On an md array with a write-intent bitmap, a thread wakes up every few seconds
and scans the bitmap looking for work to do.  If the array is idle, there will
be no work to do, but a lot of scanning is done to discover this.

So cache the fact that the bitmap is completely clean, and avoid scanning the
whole bitmap when the cache is known to be clean.

Signed-off-by: Neil Brown &lt;neilb@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>d_path: Make d_path() use a struct path</title>
<updated>2008-02-15T05:17:09Z</updated>
<author>
<name>Jan Blunck</name>
<email>jblunck@suse.de</email>
</author>
<published>2008-02-15T03:38:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cf28b4863f9ee8f122e8ff3ac0d403e07ba9c6d9'/>
<id>urn:sha1:cf28b4863f9ee8f122e8ff3ac0d403e07ba9c6d9</id>
<content type='text'>
d_path() is used on a &lt;dentry,vfsmount&gt; pair.  Lets use a struct path to
reflect this.

[akpm@linux-foundation.org: fix build in mm/memory.c]
Signed-off-by: Jan Blunck &lt;jblunck@suse.de&gt;
Acked-by: Bryan Wu &lt;bryan.wu@analog.com&gt;
Acked-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;
Cc: Neil Brown &lt;neilb@suse.de&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
