<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md/raid5-cache.c, branch v4.9</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=v4.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-10-29T05:04:03Z</updated>
<entry>
<title>raid5-cache: correct condition for empty metadata write</title>
<updated>2016-10-29T05:04:03Z</updated>
<author>
<name>Shaohua Li</name>
<email>shli@fb.com</email>
</author>
<published>2016-10-27T22:22:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9a8b27fac5bbb77337cc2e5d31d37c9936782d87'/>
<id>urn:sha1:9a8b27fac5bbb77337cc2e5d31d37c9936782d87</id>
<content type='text'>
As long as we recover one metadata block, we should write the empty metadata
write. The original code could make recovery corrupted if only one meta is
valid.

Reported-by: Zhengyuan Liu &lt;liuzhengyuan@kylinos.cn&gt;
Signed-off-by: Shaohua Li &lt;shli@fb.com&gt;
</content>
</entry>
<entry>
<title>md/raid5: write an empty meta-block when creating log super-block</title>
<updated>2016-10-24T22:28:18Z</updated>
<author>
<name>Zhengyuan Liu</name>
<email>liuzhengyuan@kylinos.cn</email>
</author>
<published>2016-10-24T08:15:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=56056c2e7d58ee705755efbe780aefff987a1dc8'/>
<id>urn:sha1:56056c2e7d58ee705755efbe780aefff987a1dc8</id>
<content type='text'>
If superblock points to an invalid meta block, r5l_load_log will set
create_super with true and create an new superblock, this runtime path
would always happen if we do no writing I/O to this array since it was
created. Writing an empty meta block could avoid this unnecessary
action at the first time we created log superblock.

Another reason is for the corretness of log recovery. Currently we have
bellow code to guarantee log revocery to be correct.

        if (ctx.seq &gt; log-&gt;last_cp_seq + 1) {
                int ret;

                ret = r5l_log_write_empty_meta_block(log, ctx.pos, ctx.seq + 10);
                if (ret)
                        return ret;
                log-&gt;seq = ctx.seq + 11;
                log-&gt;log_start = r5l_ring_add(log, ctx.pos, BLOCK_SECTORS);
                r5l_write_super(log, ctx.pos);
        } else {
                log-&gt;log_start = ctx.pos;
                log-&gt;seq = ctx.seq;
        }

If we just created a array with a journal device, log-&gt;log_start and
log-&gt;last_checkpoint should all be 0, then we write three meta block
which are valid except mid one and supposed crash happened. The ctx.seq
would equal to log-&gt;last_cp_seq + 1 and log-&gt;log_start would be set to
position of mid invalid meta block after we did a recovery, this will
lead to problems which could be avoided with this patch.

Signed-off-by: Zhengyuan Liu &lt;liuzhengyuan@kylinos.cn&gt;
Signed-off-by: Shaohua Li &lt;shli@fb.com&gt;
</content>
</entry>
<entry>
<title>md/raid5: initialize next_checkpoint field before use</title>
<updated>2016-10-24T22:28:18Z</updated>
<author>
<name>Zhengyuan Liu</name>
<email>liuzhengyuan@kylinos.cn</email>
</author>
<published>2016-10-24T01:55:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=28cd88e2b4c54a466dcae7eea1efac766d42386b'/>
<id>urn:sha1:28cd88e2b4c54a466dcae7eea1efac766d42386b</id>
<content type='text'>
No initial operation was done to this field when we
load/recovery the log, it got assignment only when IO
to raid disk was finished. So r5l_quiesce may use wrong
next_checkpoint to reclaim log space, that would make
reclaimable space calculation confused.

Signed-off-by: Zhengyuan Liu &lt;liuzhengyuan@kylinos.cn&gt;
Signed-off-by: Shaohua Li &lt;shli@fb.com&gt;
</content>
</entry>
<entry>
<title>raid5-cache: fix a deadlock in superblock write</title>
<updated>2016-08-31T16:05:18Z</updated>
<author>
<name>Shaohua Li</name>
<email>shli@fb.com</email>
</author>
<published>2016-08-25T17:09:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8e018c21da3febb558586b48c8db0d6d66cb6593'/>
<id>urn:sha1:8e018c21da3febb558586b48c8db0d6d66cb6593</id>
<content type='text'>
There is a potential deadlock in superblock write. Discard could zero data, so
before discard we must make sure superblock is updated to new log tail.
Updating superblock (either directly call md_update_sb() or depend on md
thread) must hold reconfig mutex. On the other hand, raid5_quiesce is called
with reconfig_mutex hold. The first step of raid5_quiesce() is waitting for all
IO finish, hence waitting for reclaim thread, while reclaim thread is calling
this function and waitting for reconfig mutex. So there is a deadlock. We
workaround this issue with a trylock. The downside of the solution is we could
miss discard if we can't take reconfig mutex. But this should happen rarely
(mainly in raid array stop), so miss discard shouldn't be a big problem.

Cc: NeilBrown &lt;neilb@suse.com&gt;
Signed-off-by: Shaohua Li &lt;shli@fb.com&gt;
</content>
</entry>
<entry>
<title>block: rename bio bi_rw to bi_opf</title>
<updated>2016-08-07T20:41:02Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2016-08-05T21:35:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1eff9d322a444245c67515edb52bc0eb68374aa8'/>
<id>urn:sha1:1eff9d322a444245c67515edb52bc0eb68374aa8</id>
<content type='text'>
Since commit 63a4cc24867d, bio-&gt;bi_rw contains flags in the lower
portion and the op code in the higher portions. This means that
old code that relies on manually setting bi_rw is most likely
going to be broken. Instead of letting that brokeness linger,
rename the member, to force old and out-of-tree code to break
at compile time instead of at runtime.

No intended functional changes in this commit.

Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block, drivers, fs: rename REQ_FLUSH to REQ_PREFLUSH</title>
<updated>2016-06-07T19:41:38Z</updated>
<author>
<name>Mike Christie</name>
<email>mchristi@redhat.com</email>
</author>
<published>2016-06-05T19:32:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=28a8f0d317bf225ff15008f5dd66ae16242dd843'/>
<id>urn:sha1:28a8f0d317bf225ff15008f5dd66ae16242dd843</id>
<content type='text'>
To avoid confusion between REQ_OP_FLUSH, which is handled by
request_fn drivers, and upper layers requesting the block layer
perform a flush sequence along with possibly a WRITE, this patch
renames REQ_FLUSH to REQ_PREFLUSH.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>md: use bio op accessors</title>
<updated>2016-06-07T19:41:38Z</updated>
<author>
<name>Mike Christie</name>
<email>mchristi@redhat.com</email>
</author>
<published>2016-06-05T19:32:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=796a5cf083c2631180ad209c3ebb7d11d776cd72'/>
<id>urn:sha1:796a5cf083c2631180ad209c3ebb7d11d776cd72</id>
<content type='text'>
Separate the op from the rq_flag_bits and have md
set/get the bio using bio_set_op_attrs/bio_op.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block/fs/drivers: remove rw argument from submit_bio</title>
<updated>2016-06-07T19:41:38Z</updated>
<author>
<name>Mike Christie</name>
<email>mchristi@redhat.com</email>
</author>
<published>2016-06-05T19:31:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4e49ea4a3d276365bf7396c9b77b4d1d5923835a'/>
<id>urn:sha1:4e49ea4a3d276365bf7396c9b77b4d1d5923835a</id>
<content type='text'>
This has callers of submit_bio/submit_bio_wait set the bio-&gt;bi_rw
instead of passing it in. This makes that use the same as
generic_make_request and how we set the other bio fields.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;

Fixed up fs/ext4/crypto.c

Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'md/4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md</title>
<updated>2016-05-20T00:25:13Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-05-20T00:25:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=feaa7cb5c59416143432829b15826be76605b8fe'/>
<id>urn:sha1:feaa7cb5c59416143432829b15826be76605b8fe</id>
<content type='text'>
Pull MD updates from Shaohua Li:
 "Several patches from Guoqing fixing md-cluster bugs and several
  patches from Heinz fixing dm-raid bugs"

* tag 'md/4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md:
  md-cluster: check the return value of process_recvd_msg
  md-cluster: gather resync infos and enable recv_thread after bitmap is ready
  md: set MD_CHANGE_PENDING in a atomic region
  md: raid5: add prerequisite to run underneath dm-raid
  md: raid10: add prerequisite to run underneath dm-raid
  md: md.c: fix oops in mddev_suspend for raid0
  md-cluster: fix ifnullfree.cocci warnings
  md-cluster/bitmap: unplug bitmap to sync dirty pages to disk
  md-cluster/bitmap: fix wrong page num in bitmap_file_clear_bit and bitmap_file_set_bit
  md-cluster/bitmap: fix wrong calcuation of offset
  md-cluster: sync bitmap when node received RESYNCING msg
  md-cluster: always setup in-memory bitmap
  md-cluster: wakeup thread if activated a spare disk
  md-cluster: change array_sectors and update size are not supported
  md-cluster: fix locking when node joins cluster during message broadcast
  md-cluster: unregister thread if err happened
  md-cluster: wake up thread to continue recovery
  md-cluser: make resync_finish only called after pers-&gt;sync_request
  md-cluster: change resync lock from asynchronous to synchronous
</content>
</entry>
<entry>
<title>md: set MD_CHANGE_PENDING in a atomic region</title>
<updated>2016-05-09T16:24:02Z</updated>
<author>
<name>Guoqing Jiang</name>
<email>gqjiang@suse.com</email>
</author>
<published>2016-05-04T02:22:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=85ad1d13ee9b3db00615ea24b031c15e5ba14fd1'/>
<id>urn:sha1:85ad1d13ee9b3db00615ea24b031c15e5ba14fd1</id>
<content type='text'>
Some code waits for a metadata update by:

1. flagging that it is needed (MD_CHANGE_DEVS or MD_CHANGE_CLEAN)
2. setting MD_CHANGE_PENDING and waking the management thread
3. waiting for MD_CHANGE_PENDING to be cleared

If the first two are done without locking, the code in md_update_sb()
which checks if it needs to repeat might test if an update is needed
before step 1, then clear MD_CHANGE_PENDING after step 2, resulting
in the wait returning early.

So make sure all places that set MD_CHANGE_PENDING are atomicial, and
bit_clear_unless (suggested by Neil) is introduced for the purpose.

Cc: Martin Kepplinger &lt;martink@posteo.de&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Cc: &lt;linux-kernel@vger.kernel.org&gt;
Reviewed-by: NeilBrown &lt;neilb@suse.com&gt;
Signed-off-by: Guoqing Jiang &lt;gqjiang@suse.com&gt;
Signed-off-by: Shaohua Li &lt;shli@fb.com&gt;
</content>
</entry>
</feed>
