<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/fs/gfs2/log.c, branch jd/unified-crypt-queue</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/fs/gfs2/log.c?h=jd%2Funified-crypt-queue</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/fs/gfs2/log.c?h=jd%2Funified-crypt-queue'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2020-03-30T12:55:35Z</updated>
<entry>
<title>gfs2: Fix oversight in gfs2_ail1_flush</title>
<updated>2020-03-30T12:55:35Z</updated>
<author>
<name>Bob Peterson</name>
<email>rpeterso@redhat.com</email>
</author>
<published>2020-03-27T20:23:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=75b46c437f6b0f8e37032a407c7373f85f5c26a8'/>
<id>urn:sha1:75b46c437f6b0f8e37032a407c7373f85f5c26a8</id>
<content type='text'>
Ordinarily, function gfs2_ail1_start_one issues a write request
for one item on the ail1 list, then returns -EBUSY. This makes the
caller, gfs2_ail1_flush, loop around and start another. However,
it was not clearing the -EBUSY return code each time through the loop.
So on rare occasions, like when the wbc runs out of nr_to_write, it
remained set to -EBUSY, which triggered an error and withdraw.

This patch sets the return code to 0 each time through the restart
loop so this won't happen anymore.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: instrumentation wrt ail1 stuck</title>
<updated>2020-03-27T19:08:05Z</updated>
<author>
<name>Bob Peterson</name>
<email>rpeterso@redhat.com</email>
</author>
<published>2020-03-26T17:19:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=9592ea80ad13fe06d7848028af6c917aa1cd0aaa'/>
<id>urn:sha1:9592ea80ad13fe06d7848028af6c917aa1cd0aaa</id>
<content type='text'>
Before this patch, if the ail1 flush got stuck for some reason, there
were no clues as to why. This patch introduces a check for getting
stuck for more than a minute, and if it happens, it dumps the items
still remaining on the ail1 list.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: Switch to list_{first,last}_entry</title>
<updated>2020-03-27T19:08:04Z</updated>
<author>
<name>Andreas Gruenbacher</name>
<email>agruenba@redhat.com</email>
</author>
<published>2020-02-03T18:22:45Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=969183bc68bc27d637d6d29e81d71cf854d0ca61'/>
<id>urn:sha1:969183bc68bc27d637d6d29e81d71cf854d0ca61</id>
<content type='text'>
Replace open-coded versions of list_first_entry and list_last_entry with those
functions.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: Additional information when gfs2_ail1_flush withdraws</title>
<updated>2020-03-06T16:15:03Z</updated>
<author>
<name>Bob Peterson</name>
<email>rpeterso@redhat.com</email>
</author>
<published>2020-03-06T16:15:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=490031281d5a33fbdab59e98e165c2cd30fc841b'/>
<id>urn:sha1:490031281d5a33fbdab59e98e165c2cd30fc841b</id>
<content type='text'>
Before this patch, if gfs2_ail1_flush gets an error from function
gfs2_ail1_start_one (which comes indirectly from generic_writepages)
the file system is withdrawn, but without any explanation why.

This patch adds an error message if gfs2_ail1_flush gets an error
from gfs2_ail1_start_one.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: flesh out delayed withdraw for gfs2_log_flush</title>
<updated>2020-02-27T13:53:18Z</updated>
<author>
<name>Bob Peterson</name>
<email>rpeterso@redhat.com</email>
</author>
<published>2020-01-08T17:37:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=ca399c96e96e3f372f901a698a6fd17796b8ed32'/>
<id>urn:sha1:ca399c96e96e3f372f901a698a6fd17796b8ed32</id>
<content type='text'>
Function gfs2_log_flush() had a few places where it tried to withdraw
from the file system when errors were encountered. The problem is,
it should delay those withdraws until the log flush lock is no longer
held.

This patch creates a new function just for delayed withdraws for
situations like this. If errors=panic was specified on mount, we
still want to do it the old fashioned way because the panic it does
not help to delay in that situation.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Reviewed-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: drain the ail2 list after io errors</title>
<updated>2020-02-27T13:53:18Z</updated>
<author>
<name>Bob Peterson</name>
<email>rpeterso@redhat.com</email>
</author>
<published>2019-11-13T19:58:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=2ca0c2fbf3ed7f9609333a996149d02f70e8a6f3'/>
<id>urn:sha1:2ca0c2fbf3ed7f9609333a996149d02f70e8a6f3</id>
<content type='text'>
Before this patch, gfs2_logd continually tried to flush its journal
log, after the file system is withdrawn. We don't want to write anything
to the journal, lest we add corruption. Best course of action is to
drain the ail1 into the ail2 list (via gfs2_ail1_empty) then drain the
ail2 list with a new function, ail2_drain.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Reviewed-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: Withdraw in gfs2_ail1_flush if write_cache_pages fails</title>
<updated>2020-02-27T13:53:18Z</updated>
<author>
<name>Bob Peterson</name>
<email>rpeterso@redhat.com</email>
</author>
<published>2019-11-13T19:53:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=b1676cbb11153b5bf4dd9e6c99869b284fb8160e'/>
<id>urn:sha1:b1676cbb11153b5bf4dd9e6c99869b284fb8160e</id>
<content type='text'>
Before this patch, function gfs2_ail1_start_one would return any
errors it received from write_cache_pages (except -EBUSY) but it did
not withdraw. Since function gfs2_ail1_flush just checks for the bad
return code and loops, the loop might potentially never end.
This patch adds some logic to allow it to exit the loop and withdraw
properly when errors are received from write_cache_pages.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Reviewed-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: Do log_flush in gfs2_ail_empty_gl even if ail list is empty</title>
<updated>2020-02-27T13:53:18Z</updated>
<author>
<name>Bob Peterson</name>
<email>rpeterso@redhat.com</email>
</author>
<published>2019-11-13T19:47:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=9ff78289356af640941bbb0dd3f46af2063f0046'/>
<id>urn:sha1:9ff78289356af640941bbb0dd3f46af2063f0046</id>
<content type='text'>
Before this patch, if gfs2_ail_empty_gl saw there was nothing on
the ail list, it would return and not flush the log. The problem
is that there could still be a revoke for the rgrp sitting on the
sd_log_le_revoke list that's been recently taken off the ail list.
But that revoke still needs to be written, and the rgrp_go_inval
still needs to call log_flush_wait to ensure the revokes are all
properly written to the journal before we relinquish control of
the glock to another node. If we give the glock to another node
before we have this knowledge, the node might crash and its journal
replayed, in which case the missing revoke would allow the journal
replay to replay the rgrp over top of the rgrp we already gave to
another node, thus overwriting its changes and corrupting the
file system.

This patch makes gfs2_ail_empty_gl still call gfs2_log_flush rather
than returning.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Reviewed-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: Issue revokes more intelligently</title>
<updated>2020-02-27T13:53:18Z</updated>
<author>
<name>Bob Peterson</name>
<email>rpeterso@redhat.com</email>
</author>
<published>2019-02-21T21:28:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=5e4c7632aae1cce137792647f4fb6f599d1da893'/>
<id>urn:sha1:5e4c7632aae1cce137792647f4fb6f599d1da893</id>
<content type='text'>
Before this patch, function gfs2_write_revokes would call
gfs2_ail1_empty, then traverse the sd_ail1_list looking for
transactions that had bds which were no longer queued to a glock.
And if it found some, it would try to issue revokes for them, up to
a predetermined maximum. There were two problems with how it did
this. First was the fact that gfs2_ail1_empty moves transactions
which have nothing remaining on the ail1 list from the sd_ail1_list
to the sd_ail2_list, thus making its traversal of sd_ail1_list
miss them completely, and therefore, never issue revokes for them.
Second was the fact that there were three traversals (or partial
traversals) of the sd_ail1_list, each of which took and then
released the sd_ail_lock lock: First inside gfs2_ail1_empty,
second to determine if there are any revokes to be issued, and
third to actually issue them. All this taking and releasing of the
sd_ail_lock meant other processes could modify the lists and the
conditions in which we're working.

This patch simplies the whole process by adding a new parameter
to function gfs2_ail1_empty, max_revokes. For normal calls, this
is passed in as 0, meaning we don't want to issue any revokes.
For function gfs2_write_revokes, we pass in the maximum number
of revokes we can, thus allowing gfs2_ail1_empty to add the
revokes where needed. This simplies the code, allows for a single
holding of the sd_ail_lock, and allows gfs2_ail1_empty to add
revokes for all the necessary bd items without missing any.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Reviewed-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: log error reform</title>
<updated>2020-02-10T13:39:49Z</updated>
<author>
<name>Bob Peterson</name>
<email>rpeterso@redhat.com</email>
</author>
<published>2019-04-10T17:46:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=036330c914365f449ead353ef152fb29411cd4cb'/>
<id>urn:sha1:036330c914365f449ead353ef152fb29411cd4cb</id>
<content type='text'>
Before this patch, gfs2 kept track of journal io errors in two
places sd_log_error and the SDF_AIL1_IO_ERROR flag in sd_flags.
This patch consolidates the two into sd_log_error so that it
reflects the first error encountered writing to the journal.
In future patches, we will take advantage of this by checking
this value rather than having to check both when reacting to
io errors.

In addition, this fixes a tight loop in unmount: If buffers
get on the ail1 list and an io error occurs elsewhere, the
ail1 list would never be cleared because they were always busy.
So unmount would hang, waiting for the ail1 list to empty.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Reviewed-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
</feed>
