<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/gfs2, 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-07-14T14:59:02Z</updated>
<entry>
<title>gfs2: Fix error handling in init_statfs</title>
<updated>2021-07-14T14:59:02Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2021-06-28T11:14:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=662e158b09dd0ecbd62509d447a0d05d569cb704'/>
<id>urn:sha1:662e158b09dd0ecbd62509d447a0d05d569cb704</id>
<content type='text'>
commit 5d49d3508b3c67201bd3e1bf7f4ef049111b7051 upstream.

On an error path, init_statfs calls iput(pn) after pn has already been put.
Fix that by setting pn to NULL after the initial iput.

Fixes: 97fd734ba17e ("gfs2: lookup local statfs inodes prior to journal recovery")
Cc: stable@vger.kernel.org # v5.10+
Reported-by: Jing Xiangfeng &lt;jingxiangfeng@huawei.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>gfs2: Fix underflow in gfs2_page_mkwrite</title>
<updated>2021-07-14T14:59:02Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2021-06-21T20:28:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5181be0f1c44ce3d4e11d7a2e8d80a8c267220ef'/>
<id>urn:sha1:5181be0f1c44ce3d4e11d7a2e8d80a8c267220ef</id>
<content type='text'>
commit d3c51c55cb9274dd43c156f1f26b5eb4d5f2d58c upstream.

On filesystems with a block size smaller than PAGE_SIZE and non-empty
files smaller then PAGE_SIZE, gfs2_page_mkwrite could end up allocating
excess blocks beyond the end of the file, similar to fallocate.  This
doesn't make sense; fix it.

Reported-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Fixes: 184b4e60853d ("gfs2: Fix end-of-file handling in gfs2_page_mkwrite")
Cc: stable@vger.kernel.org # v5.5+
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>gfs2: Fix use-after-free in gfs2_glock_shrink_scan</title>
<updated>2021-06-18T08:02:50Z</updated>
<author>
<name>Hillf Danton</name>
</author>
<published>2021-05-18T08:46:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e87ef30fe73e7e10d2c85bdcc778dcec24dca553'/>
<id>urn:sha1:e87ef30fe73e7e10d2c85bdcc778dcec24dca553</id>
<content type='text'>
[ Upstream commit 1ab19c5de4c537ec0d9b21020395a5b5a6c059b2 ]

The GLF_LRU flag is checked under lru_lock in gfs2_glock_remove_from_lru() to
remove the glock from the lru list in __gfs2_glock_put().

On the shrink scan path, the same flag is cleared under lru_lock but because
of cond_resched_lock(&amp;lru_lock) in gfs2_dispose_glock_lru(), progress on the
put side can be made without deleting the glock from the lru list.

Keep GLF_LRU across the race window opened by cond_resched_lock(&amp;lru_lock) to
ensure correct behavior on both sides - clear GLF_LRU after list_del under
lru_lock.

Reported-by: syzbot &lt;syzbot+34ba7ddbf3021981a228@syzkaller.appspotmail.com&gt;
Signed-off-by: Hillf Danton &lt;hdanton@sina.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: 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: fix a deadlock on withdraw-during-mount</title>
<updated>2021-06-18T08:02:49Z</updated>
<author>
<name>Bob Peterson</name>
</author>
<published>2021-05-18T13:14:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=10f5b5e9052aaff3dc662f1c85b627e28203c532'/>
<id>urn:sha1:10f5b5e9052aaff3dc662f1c85b627e28203c532</id>
<content type='text'>
[ Upstream commit 865cc3e9cc0b1d4b81c10d53174bced76decf888 ]

Before this patch, gfs2 would deadlock because of the following
sequence during mount:

mount
   gfs2_fill_super
      gfs2_make_fs_rw &lt;--- Detects IO error with glock
         kthread_stop(sdp-&gt;sd_quotad_process);
            &lt;--- Blocked waiting for quotad to finish

logd
   Detects IO error and the need to withdraw
   calls gfs2_withdraw
      gfs2_make_fs_ro
         kthread_stop(sdp-&gt;sd_quotad_process);
            &lt;--- Blocked waiting for quotad to finish

gfs2_quotad
   gfs2_statfs_sync
      gfs2_glock_wait &lt;---- Blocked waiting for statfs glock to be granted

glock_work_func
   do_xmote &lt;---Detects IO error, can't release glock: blocked on withdraw
      glops-&gt;go_inval
      glock_blocked_by_withdraw
         requeue glock work &amp; exit &lt;--- work requeued, blocked by withdraw

This patch makes a special exception for the statfs system inode glock,
which allows the statfs glock UNLOCK to proceed normally. That allows the
quotad daemon to exit during the withdraw, which allows the logd daemon
to exit during the withdraw, which allows the mount to exit.

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: Prevent direct-I/O write fallback errors from getting lost</title>
<updated>2021-06-18T08:02:49Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2021-05-10T10:25:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6e66fcf45d9081baa0d8f4dbb1e1b05b42fd6f8f'/>
<id>urn:sha1:6e66fcf45d9081baa0d8f4dbb1e1b05b42fd6f8f</id>
<content type='text'>
[ Upstream commit 43a511c44e58e357a687d61a20cf5ef1dc9e5a7c ]

When a direct I/O write falls entirely and falls back to buffered I/O and the
buffered I/O fails, the write failed with return value 0 instead of the error
number reported by the buffered I/O. Fix that.

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: fix scheduling while atomic bug in glocks</title>
<updated>2021-06-10T11:41:44Z</updated>
<author>
<name>Bob Peterson</name>
</author>
<published>2021-05-18T13:12:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=112c92cf82a2dbc6a4855bd56b58011522b12049'/>
<id>urn:sha1:112c92cf82a2dbc6a4855bd56b58011522b12049</id>
<content type='text'>
commit 20265d9a67e40eafd39a8884658ca2e36f05985d upstream.

Before this patch, in the unlikely event that gfs2_glock_dq encountered
a withdraw, it would do a wait_on_bit to wait for its journal to be
recovered, but it never released the glock's spin_lock, which caused a
scheduling-while-atomic error.

This patch unlocks the lockref spin_lock before waiting for recovery.

Fixes: 601ef0d52e96 ("gfs2: Force withdraw to replay journals and wait for it to finish")
Cc: stable@vger.kernel.org # v5.7+
Reported-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: Bob Peterson &lt;rpeterso@redhat.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'gfs2-v5.12-rc2-fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2</title>
<updated>2021-04-03T19:15:01Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2021-04-03T19:15:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8e29be3468d4565dd95fbb098df0d7a79ee60d71'/>
<id>urn:sha1:8e29be3468d4565dd95fbb098df0d7a79ee60d71</id>
<content type='text'>
Pull gfs2 fixes from Andreas Gruenbacher:
 "Two more gfs2 fixes"

* tag 'gfs2-v5.12-rc2-fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
  gfs2: report "already frozen/thawed" errors
  gfs2: Flag a withdraw if init_threads() fails
</content>
</entry>
<entry>
<title>gfs2: report "already frozen/thawed" errors</title>
<updated>2021-03-25T17:53:38Z</updated>
<author>
<name>Bob Peterson</name>
</author>
<published>2021-03-25T12:51:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ff132c5f93c06bd4432bbab5c369e468653bdec4'/>
<id>urn:sha1:ff132c5f93c06bd4432bbab5c369e468653bdec4</id>
<content type='text'>
Before this patch, gfs2's freeze function failed to report an error
when the target file system was already frozen as it should (and as
generic vfs function freeze_super does. Similarly, gfs2's thaw function
failed to report an error when trying to thaw a file system that is not
frozen, as vfs function thaw_super does. The errors were checked, but
it always returned a 0 return code.

This patch adds the missing error return codes to gfs2 freeze and thaw.

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: Flag a withdraw if init_threads() fails</title>
<updated>2021-03-15T14:32:42Z</updated>
<author>
<name>Andrew Price</name>
</author>
<published>2021-03-15T12:24:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=62dd0f98a0e5668424270b47a0c2e973795faba7'/>
<id>urn:sha1:62dd0f98a0e5668424270b47a0c2e973795faba7</id>
<content type='text'>
Interrupting mount with ^C quickly enough can cause the kthread_run()
calls in gfs2's init_threads() to fail and the error path leads to a
deadlock on the s_umount rwsem. The abridged chain of events is:

  [mount path]
  get_tree_bdev()
    sget_fc()
      alloc_super()
        down_write_nested(&amp;s-&gt;s_umount, SINGLE_DEPTH_NESTING); [acquired]
    gfs2_fill_super()
      gfs2_make_fs_rw()
        init_threads()
          kthread_run()
            ( Interrupted )
      [Error path]
      gfs2_gl_hash_clear()
        flush_workqueue(glock_workqueue)
          wait_for_completion()

  [workqueue context]
  glock_work_func()
    run_queue()
      do_xmote()
        freeze_go_sync()
          freeze_super()
            down_write(&amp;sb-&gt;s_umount) [deadlock]

In freeze_go_sync() there is a gfs2_withdrawn() check that we can use to
make sure freeze_super() is not called in the error path, so add a
gfs2_withdraw_delayed() call when init_threads() fails.

Ref: https://bugzilla.kernel.org/show_bug.cgi?id=212231

Reported-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: Andrew Price &lt;anprice@redhat.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
</entry>
</feed>
