<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/md/md-cluster.c, branch linux-4.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-05-09T16:24:04Z</updated>
<entry>
<title>md-cluster: check the return value of process_recvd_msg</title>
<updated>2016-05-09T16:24:04Z</updated>
<author>
<name>Guoqing Jiang</name>
</author>
<published>2016-05-04T02:22:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1fa9a1ad0a9db3c745fe0c1bfa73fd87901fd7f3'/>
<id>urn:sha1:1fa9a1ad0a9db3c745fe0c1bfa73fd87901fd7f3</id>
<content type='text'>
We don't need to run the full path of recv_daemon
if process_recvd_msg doesn't return 0.

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>
<entry>
<title>md-cluster: gather resync infos and enable recv_thread after bitmap is ready</title>
<updated>2016-05-09T16:24:03Z</updated>
<author>
<name>Guoqing Jiang</name>
</author>
<published>2016-05-04T06:17:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=51e453aecb267b6a99b1d2853bccd5bba7340236'/>
<id>urn:sha1:51e453aecb267b6a99b1d2853bccd5bba7340236</id>
<content type='text'>
The in-memory bitmap is not ready when node joins cluster,
so it doesn't make sense to make gather_all_resync_info()
called so earlier, we need to call it after the node's
bitmap is setup. Also, recv_thread could be wake up after
node joins cluster, but it could cause problem if node
receives RESYNCING message without persionality since
mddev-&gt;pers-&gt;quiesce is called in process_suspend_info.

This commit introduces a new cluster interface load_bitmaps
to fix above problems, load_bitmaps is called in bitmap_load
where bitmap and persionality are ready, and load_bitmaps
does the following tasks:

1. call gather_all_resync_info to load all the node's
   bitmap info.
2. set MD_CLUSTER_ALREADY_IN_CLUSTER bit to recv_thread
   could be wake up, and wake up recv_thread if there is
   pending recv event.

Then ack_bast only wakes up recv_thread after IN_CLUSTER
bit is ready otherwise MD_CLUSTER_PENDING_RESYNC_EVENT is
set.

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>
<entry>
<title>md-cluster: sync bitmap when node received RESYNCING msg</title>
<updated>2016-05-04T19:39:35Z</updated>
<author>
<name>Guoqing Jiang</name>
</author>
<published>2016-05-02T15:50:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18c9ff7f487efa8e88886bee21bd3516dde05bc5'/>
<id>urn:sha1:18c9ff7f487efa8e88886bee21bd3516dde05bc5</id>
<content type='text'>
If the node received RESYNCING message which means
another node will perform resync with the area, then
we don't want to do it again in another node.

Let's set RESYNC_MASK and clear NEEDED_MASK for the
region from old-low to new-low which has finished
syncing, and the region from old-hi to new-hi is about
to syncing, bitmap_sync_with_cluste is introduced for
the purpose.

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>
<entry>
<title>md-cluster: fix locking when node joins cluster during message broadcast</title>
<updated>2016-05-04T19:39:35Z</updated>
<author>
<name>Guoqing Jiang</name>
</author>
<published>2016-05-02T15:33:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1535212c542285e430d44a75bfc0a99df610f598'/>
<id>urn:sha1:1535212c542285e430d44a75bfc0a99df610f598</id>
<content type='text'>
If a node joins the cluster while a message broadcast
is under way, a lock issue could happen as follows.

For a cluster which included two nodes, if node A is
calling __sendmsg before up-convert CR to EX on ack,
and node B released CR on ack. But if a new node C
joins the cluster and it doesn't receive the message
which A sent before, so it could hold CR on ack before
A up-convert CR to EX on ack.

So a node joining the cluster should get an EX lock on
the "token" first to ensure no broadcast is ongoing,
then release it after held CR on ack.

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>
<entry>
<title>md-cluster: unregister thread if err happened</title>
<updated>2016-05-04T19:39:35Z</updated>
<author>
<name>Guoqing Jiang</name>
</author>
<published>2016-05-02T15:33:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5b0fb33e8aa1c8a94f763d1025445146412ca766'/>
<id>urn:sha1:5b0fb33e8aa1c8a94f763d1025445146412ca766</id>
<content type='text'>
The two threads need to be unregistered if a node
can't join cluster successfully.

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>
<entry>
<title>md-cluster: wake up thread to continue recovery</title>
<updated>2016-05-04T19:39:35Z</updated>
<author>
<name>Guoqing Jiang</name>
</author>
<published>2016-05-02T15:33:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb315cd0933b903126996e79c12cb1eae617a036'/>
<id>urn:sha1:eb315cd0933b903126996e79c12cb1eae617a036</id>
<content type='text'>
In recovery case, we need to set MD_RECOVERY_NEEDED
and wake up thread only if recover is not finished.

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>
<entry>
<title>md-cluster: change resync lock from asynchronous to synchronous</title>
<updated>2016-05-04T19:39:35Z</updated>
<author>
<name>Guoqing Jiang</name>
</author>
<published>2016-05-02T15:33:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=41a9a0dcf8954654467f979838938e39ef4da590'/>
<id>urn:sha1:41a9a0dcf8954654467f979838938e39ef4da590</id>
<content type='text'>
If multiple nodes choose to attempt do resync at the same time
they need to be serialized so they don't duplicate effort. This
serialization is done by locking the 'resync' DLM lock.

Currently if a node cannot get the lock immediately it doesn't
request notification when the lock becomes available (i.e.
DLM_LKF_NOQUEUE is set), so it may not reliably find out when it
is safe to try again.

Rather than trying to arrange an async wake-up when the lock
becomes available, switch to using synchronous locking - this is
a lot easier to think about.  As it is not permitted to block in
the 'raid1d' thread, move the locking to the resync thread.  So
the rsync thread is forked immediately, but it blocks until the
resync lock is available. Once the lock is locked it checks again
if any resync action is needed.

A particular symptom of the current problem is that a node can
get stuck with "resync=pending" indefinitely.

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>
<entry>
<title>md-cluster: fix missing memory free</title>
<updated>2016-01-25T02:13:18Z</updated>
<author>
<name>Shaohua Li</name>
</author>
<published>2016-01-22T23:54:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4ac7a65f8070098187b1e2afa992848366aae079'/>
<id>urn:sha1:4ac7a65f8070098187b1e2afa992848366aae079</id>
<content type='text'>
There are several places we allocate dlm_lock_resource, but not free it.

leave() need free a lock resource too (from Guoqing)
Cc: Goldwyn Rodrigues &lt;rgoldwyn@suse.com&gt;
Cc: Guoqing Jiang &lt;gqjiang@suse.com&gt;
Cc: NeilBrown &lt;neilb@suse.com&gt;
Signed-off-by: Shaohua Li &lt;shli@fb.com&gt;
</content>
</entry>
<entry>
<title>md-cluster: update comments for MD_CLUSTER_SEND_LOCKED_ALREADY</title>
<updated>2016-01-06T00:39:21Z</updated>
<author>
<name>Guoqing Jiang</name>
</author>
<published>2015-12-20T23:51:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e19508fa4df896b115f5321c21ce7669559b0863'/>
<id>urn:sha1:e19508fa4df896b115f5321c21ce7669559b0863</id>
<content type='text'>
1. fix unbalanced parentheses.
2. add more description about that MD_CLUSTER_SEND_LOCKED_ALREADY
   will be cleared after set it in add_new_disk.

Signed-off-by: Guoqing Jiang &lt;gqjiang@suse.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.com&gt;
</content>
</entry>
<entry>
<title>md-cluster: Protect communication with mutexes</title>
<updated>2016-01-06T00:39:17Z</updated>
<author>
<name>Guoqing Jiang</name>
</author>
<published>2015-12-20T23:51:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b9277c81450de9d8081ff6571ac5986e6c83f49'/>
<id>urn:sha1:8b9277c81450de9d8081ff6571ac5986e6c83f49</id>
<content type='text'>
Communication can happen through multiple threads. It is possible that
one thread steps over another threads sequence. So, we use mutexes to
protect both the send and receive sequences.

Send communication is locked through state bit, MD_CLUSTER_SEND_LOCK.
Communication is locked with bit manipulation in order to allow
"lock and hold" for the add operation. In case of an add operation,
if the lock is held, MD_CLUSTER_SEND_LOCKED_ALREADY is set.
When md_update_sb() calls metadata_update_start(), it checks
(in a single statement to avoid races), if the communication
is already locked. If yes, it merely returns zero, else it
locks the token lockresource.

Signed-off-by: Goldwyn Rodrigues &lt;rgoldwyn@suse.com&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.com&gt;
</content>
</entry>
</feed>
