<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/gfs2/log.c, branch linux-5.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-06-18T08:02:49Z</updated>
<entry>
<title>gfs2: Clean up revokes on normal withdraws</title>
<updated>2021-06-18T08:02:49Z</updated>
<author>
<name>Bob Peterson</name>
</author>
<published>2021-05-19T18:54:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d27e9b57e710220d077052b449e13f53c9730a52'/>
<id>urn:sha1:d27e9b57e710220d077052b449e13f53c9730a52</id>
<content type='text'>
[ Upstream commit f5456b5d67cf812fd31fe3e130ca216b2e0908e5 ]

Before this patch, the system ail lists were cleaned up if the logd
process withdrew, but on other withdraws, they were not cleaned up.
This included the cleaning up of the revokes as well.

This patch reorganizes things a bit so that all withdraws (not just logd)
clean up the ail lists, including any pending revokes.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>gfs2: bypass log flush if the journal is not live</title>
<updated>2021-03-12T14:52:48Z</updated>
<author>
<name>Bob Peterson</name>
</author>
<published>2021-03-12T13:47:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0efc4976e3da40b09c592b21f722022d8f12a16b'/>
<id>urn:sha1:0efc4976e3da40b09c592b21f722022d8f12a16b</id>
<content type='text'>
Patch fe3e397668775 ("gfs2: Rework the log space allocation logic")
changed gfs2_log_flush to reserve a set of journal blocks in case no
transaction is active.  However, gfs2_log_flush also gets called in
cases where we don't have an active journal, for example, for spectator
mounts.  In that case, trying to reserve blocks would sleep forever, but
we want gfs2_log_flush to be a no-op instead.

Fixes: fe3e397668775 ("gfs2: Rework the log space allocation logic")
Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: fix use-after-free in trans_drain</title>
<updated>2021-03-07T16:04:55Z</updated>
<author>
<name>Bob Peterson</name>
</author>
<published>2021-02-25T16:11:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a5a2cfd34c17db73c53ef127272c8c1ae220485'/>
<id>urn:sha1:1a5a2cfd34c17db73c53ef127272c8c1ae220485</id>
<content type='text'>
This patch adds code to function trans_drain to remove drained
bd elements from the ail lists, if queued, before freeing the bd.
If we don't remove the bd from the ail, function ail_drain will
try to reference the bd after it has been freed by trans_drain.

Thanks to Andy Price for his analysis of the problem.

Reported-by: Andy Price &lt;anprice@redhat.com&gt;
Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: Don't get stuck with I/O plugged in gfs2_ail1_flush</title>
<updated>2021-02-23T18:01:42Z</updated>
<author>
<name>Bob Peterson</name>
</author>
<published>2021-02-18T14:07:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=17d77684088510df84ff8285982d0eed52cd5890'/>
<id>urn:sha1:17d77684088510df84ff8285982d0eed52cd5890</id>
<content type='text'>
In gfs2_ail1_flush, we're using I/O plugging to give the block layer a
better chance of merging I/O requests.  If we're too aggressive here, we
can end up waiting on I/O to complete while still plugged.  Fix that in
a way similar to writeback_sb_inodes, except that we can't use
blk_flush_plug because blk_flush_plug_list is not exported.

Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge branches 'rgrp-glock-sharing' and 'gfs2-revoke' from https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git</title>
<updated>2021-02-23T17:54:22Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2021-02-22T20:22:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=803074ad77b91e270c1ce90793a924cdb4547162'/>
<id>urn:sha1:803074ad77b91e270c1ce90793a924cdb4547162</id>
<content type='text'>
Merge the resource group glock sharing feature and the revoke accounting rework.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: Per-revoke accounting in transactions</title>
<updated>2021-02-22T20:16:23Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2020-12-17T15:14:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2129b4288852cf872c42870c7f6e813ce0611199'/>
<id>urn:sha1:2129b4288852cf872c42870c7f6e813ce0611199</id>
<content type='text'>
In the log, revokes are stored as a revoke descriptor (struct
gfs2_log_descriptor), followed by zero or more additional revoke blocks
(struct gfs2_meta_header).  On filesystems with a blocksize of 4k, the
revoke descriptor contains up to 503 revokes, and the metadata blocks
contain up to 509 revokes each.  We've so far been reserving space for
revokes in transactions in block granularity, so a lot more space than
necessary was being allocated and then released again.

This patch switches to assigning revokes to transactions individually
instead.  Initially, space for the revoke descriptor is reserved and
handed out to transactions.  When more revokes than that are reserved,
additional revoke blocks are added.  When the log is flushed, the space
for the additional revoke blocks is released, but we keep the space for
the revoke descriptor block allocated.

Transactions may still reserve more revokes than they will actually need
in the end, but now we won't overshoot the target as much, and by only
returning the space for excess revokes at log flush time, we further
reduce the amount of contention between processes.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: Rework the log space allocation logic</title>
<updated>2021-02-22T20:16:22Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2020-12-10T11:49:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe3e397668775e20ad0962459733158838b926af'/>
<id>urn:sha1:fe3e397668775e20ad0962459733158838b926af</id>
<content type='text'>
The current log space allocation logic is hard to understand or extend.
The principle it that when the log is flushed, we may or may not have a
transaction active that has space allocated in the log.  To deal with
that, we set aside a magical number of blocks to be used in case we
don't have an active transaction.  It isn't clear that the pool will
always be big enough.  In addition, we can't return unused log space at
the end of a transaction, so the number of blocks allocated must exactly
match the number of blocks used.

Simplify this as follows:
 * When transactions are allocated or merged, always reserve enough
   blocks to flush the transaction (err on the safe side).
 * In gfs2_log_flush, return any allocated blocks that haven't been used.
 * Maintain a pool of spare blocks big enough to do one log flush, as
   before.
 * In gfs2_log_flush, when we have no active transaction, allocate a
   suitable number of blocks.  For that, use the spare pool when
   called from logd, and leave the pool alone otherwise.  This means
   that when the log is almost full, logd will still be able to do one
   more log flush, which will result in more log space becoming
   available.

This will make the log space allocator code easier to work with in
the future.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: Minor calc_reserved cleanup</title>
<updated>2021-02-22T20:16:22Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2021-01-29T18:56:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=71b219f4e50b12efffbc8107408e17904f9c47e6'/>
<id>urn:sha1:71b219f4e50b12efffbc8107408e17904f9c47e6</id>
<content type='text'>
No functional change.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: Move function gfs2_ail_empty_tr</title>
<updated>2021-02-03T17:37:25Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2020-12-19T09:54:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=76fce6548961a0c6246c4796e71800cdc63d5851'/>
<id>urn:sha1:76fce6548961a0c6246c4796e71800cdc63d5851</id>
<content type='text'>
Move this function further up in log.c so that we can use it in the next patch.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
<entry>
<title>gfs2: Get rid of current_tail()</title>
<updated>2021-02-03T17:37:25Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2020-12-19T06:15:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5cb738b5fbd2f3ebe9dec0e428577a4f2128adbe'/>
<id>urn:sha1:5cb738b5fbd2f3ebe9dec0e428577a4f2128adbe</id>
<content type='text'>
Keep the current value of the updated log tail in the super block as
sb_log_flush_tail instead of computing it on the fly.  This avoids
unnecessary sd_ail_lock taking and cleans up the code.

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