<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/gfs2, branch v6.7</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge tag 'gfs2-v6.6-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2</title>
<updated>2023-11-07T19:54:17+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-11-07T19:54:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1a0507d8780e2902c4c17c5a4c45d298bd7048af'/>
<id>1a0507d8780e2902c4c17c5a4c45d298bd7048af</id>
<content type='text'>
Pull gfs2 updates from Andreas Gruenbacher:

 - Don't update inode timestamps for direct writes (performance
   regression fix)

 - Skip no-op quota records instead of panicing

 - Fix a RCU race in gfs2_permission()

 - Various other smaller fixes and cleanups all over the place

* tag 'gfs2-v6.6-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: (24 commits)
  gfs2: don't withdraw if init_threads() got interrupted
  gfs2: remove dead code in add_to_queue
  gfs2: Fix slab-use-after-free in gfs2_qd_dealloc
  gfs2: Silence "suspicious RCU usage in gfs2_permission" warning
  gfs2: fs: derive f_fsid from s_uuid
  gfs2: No longer use 'extern' in function declarations
  gfs2: Rename gfs2_lookup_{ simple =&gt; meta }
  gfs2: Convert gfs2_internal_read to folios
  gfs2: Convert stuffed_readpage to folios
  gfs2: Minor gfs2_write_jdata_batch PAGE_SIZE cleanup
  gfs2: Get rid of gfs2_alloc_blocks generation parameter
  gfs2: Add metapath_dibh helper
  gfs2: Clean up quota.c:print_message
  gfs2: Clean up gfs2_alloc_parms initializers
  gfs2: Two quota=account mode fixes
  gfs2: Stop using GFS2_BASIC_BLOCK and GFS2_BASIC_BLOCK_SHIFT
  gfs2: setattr_chown: Add missing initialization
  gfs2: fix an oops in gfs2_permission
  gfs2: ignore negated quota changes
  gfs2: Don't update inode timestamps for direct writes
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull gfs2 updates from Andreas Gruenbacher:

 - Don't update inode timestamps for direct writes (performance
   regression fix)

 - Skip no-op quota records instead of panicing

 - Fix a RCU race in gfs2_permission()

 - Various other smaller fixes and cleanups all over the place

* tag 'gfs2-v6.6-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: (24 commits)
  gfs2: don't withdraw if init_threads() got interrupted
  gfs2: remove dead code in add_to_queue
  gfs2: Fix slab-use-after-free in gfs2_qd_dealloc
  gfs2: Silence "suspicious RCU usage in gfs2_permission" warning
  gfs2: fs: derive f_fsid from s_uuid
  gfs2: No longer use 'extern' in function declarations
  gfs2: Rename gfs2_lookup_{ simple =&gt; meta }
  gfs2: Convert gfs2_internal_read to folios
  gfs2: Convert stuffed_readpage to folios
  gfs2: Minor gfs2_write_jdata_batch PAGE_SIZE cleanup
  gfs2: Get rid of gfs2_alloc_blocks generation parameter
  gfs2: Add metapath_dibh helper
  gfs2: Clean up quota.c:print_message
  gfs2: Clean up gfs2_alloc_parms initializers
  gfs2: Two quota=account mode fixes
  gfs2: Stop using GFS2_BASIC_BLOCK and GFS2_BASIC_BLOCK_SHIFT
  gfs2: setattr_chown: Add missing initialization
  gfs2: fix an oops in gfs2_permission
  gfs2: ignore negated quota changes
  gfs2: Don't update inode timestamps for direct writes
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>gfs2: don't withdraw if init_threads() got interrupted</title>
<updated>2023-11-06T00:51:26+00:00</updated>
<author>
<name>Andreas Gruenbacher</name>
<email>agruenba@redhat.com</email>
</author>
<published>2023-11-02T19:52:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0cdc6f44e9fdc2d20d720145bf99a39f611f6d61'/>
<id>0cdc6f44e9fdc2d20d720145bf99a39f611f6d61</id>
<content type='text'>
In gfs2_fill_super(), when mounting a gfs2 filesystem is interrupted,
kthread_create() can return -EINTR.  When that happens, we roll back
what has already been done and abort the mount.

Since commit 62dd0f98a0e5 ("gfs2: Flag a withdraw if init_threads()
fails), we are calling gfs2_withdraw_delayed() in gfs2_fill_super();
first via gfs2_make_fs_rw(), then directly.  But gfs2_withdraw_delayed()
only marks the filesystem as withdrawing and relies on a caller further
up the stack to do the actual withdraw, which doesn't exist in the
gfs2_fill_super() case.  Because the filesystem is marked as withdrawing
/ withdrawn, function gfs2_lm_unmount() doesn't release the dlm
lockspace, so when we try to mount that filesystem again, we get:

    gfs2: fsid=gohan:gohan0: Trying to join cluster "lock_dlm", "gohan:gohan0"
    gfs2: fsid=gohan:gohan0: dlm_new_lockspace error -17

Since commit b77b4a4815a9 ("gfs2: Rework freeze / thaw logic"), the
deadlock this gfs2_withdraw_delayed() call was supposed to work around
cannot occur anymore because freeze_go_callback() won't take the
sb-&gt;s_umount semaphore unconditionally anymore, so we can get rid of the
gfs2_withdraw_delayed() in gfs2_fill_super() entirely.

Reported-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Cc: stable@vger.kernel.org # v6.5+
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In gfs2_fill_super(), when mounting a gfs2 filesystem is interrupted,
kthread_create() can return -EINTR.  When that happens, we roll back
what has already been done and abort the mount.

Since commit 62dd0f98a0e5 ("gfs2: Flag a withdraw if init_threads()
fails), we are calling gfs2_withdraw_delayed() in gfs2_fill_super();
first via gfs2_make_fs_rw(), then directly.  But gfs2_withdraw_delayed()
only marks the filesystem as withdrawing and relies on a caller further
up the stack to do the actual withdraw, which doesn't exist in the
gfs2_fill_super() case.  Because the filesystem is marked as withdrawing
/ withdrawn, function gfs2_lm_unmount() doesn't release the dlm
lockspace, so when we try to mount that filesystem again, we get:

    gfs2: fsid=gohan:gohan0: Trying to join cluster "lock_dlm", "gohan:gohan0"
    gfs2: fsid=gohan:gohan0: dlm_new_lockspace error -17

Since commit b77b4a4815a9 ("gfs2: Rework freeze / thaw logic"), the
deadlock this gfs2_withdraw_delayed() call was supposed to work around
cannot occur anymore because freeze_go_callback() won't take the
sb-&gt;s_umount semaphore unconditionally anymore, so we can get rid of the
gfs2_withdraw_delayed() in gfs2_fill_super() entirely.

Reported-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
Cc: stable@vger.kernel.org # v6.5+
</pre>
</div>
</content>
</entry>
<entry>
<title>gfs2: remove dead code in add_to_queue</title>
<updated>2023-11-06T00:51:26+00:00</updated>
<author>
<name>Su Hui</name>
<email>suhui@nfschina.com</email>
</author>
<published>2023-11-02T01:51:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bb25b97562e52b2b5808b348db32568b1f5394b5'/>
<id>bb25b97562e52b2b5808b348db32568b1f5394b5</id>
<content type='text'>
clang static analyzer complains that value stored to 'gh' is never read.
The code of this line is useless after commit 0b93bac2271e
("gfs2: Remove LM_FLAG_PRIORITY flag"). Remove this code to save space.

Signed-off-by: Su Hui &lt;suhui@nfschina.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
clang static analyzer complains that value stored to 'gh' is never read.
The code of this line is useless after commit 0b93bac2271e
("gfs2: Remove LM_FLAG_PRIORITY flag"). Remove this code to save space.

Signed-off-by: Su Hui &lt;suhui@nfschina.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfs2: Fix slab-use-after-free in gfs2_qd_dealloc</title>
<updated>2023-11-06T00:51:26+00:00</updated>
<author>
<name>Juntong Deng</name>
<email>juntong.deng@outlook.com</email>
</author>
<published>2023-10-29T21:10:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bdcb8aa434c6d36b5c215d02a9ef07551be25a37'/>
<id>bdcb8aa434c6d36b5c215d02a9ef07551be25a37</id>
<content type='text'>
In gfs2_put_super(), whether withdrawn or not, the quota should
be cleaned up by gfs2_quota_cleanup().

Otherwise, struct gfs2_sbd will be freed before gfs2_qd_dealloc (rcu
callback) has run for all gfs2_quota_data objects, resulting in
use-after-free.

Also, gfs2_destroy_threads() and gfs2_quota_cleanup() is already called
by gfs2_make_fs_ro(), so in gfs2_put_super(), after calling
gfs2_make_fs_ro(), there is no need to call them again.

Reported-by: syzbot+29c47e9e51895928698c@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=29c47e9e51895928698c
Signed-off-by: Juntong Deng &lt;juntong.deng@outlook.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In gfs2_put_super(), whether withdrawn or not, the quota should
be cleaned up by gfs2_quota_cleanup().

Otherwise, struct gfs2_sbd will be freed before gfs2_qd_dealloc (rcu
callback) has run for all gfs2_quota_data objects, resulting in
use-after-free.

Also, gfs2_destroy_threads() and gfs2_quota_cleanup() is already called
by gfs2_make_fs_ro(), so in gfs2_put_super(), after calling
gfs2_make_fs_ro(), there is no need to call them again.

Reported-by: syzbot+29c47e9e51895928698c@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=29c47e9e51895928698c
Signed-off-by: Juntong Deng &lt;juntong.deng@outlook.com&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfs2: Silence "suspicious RCU usage in gfs2_permission" warning</title>
<updated>2023-11-06T00:51:26+00:00</updated>
<author>
<name>Andreas Gruenbacher</name>
<email>agruenba@redhat.com</email>
</author>
<published>2023-10-30T21:06:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=074d7306a4fe22fcac0b53f699f92757ab1cee99'/>
<id>074d7306a4fe22fcac0b53f699f92757ab1cee99</id>
<content type='text'>
Commit 0abd1557e21c added rcu_dereference() for dereferencing ip-&gt;i_gl
in gfs2_permission.  This now causes lockdep to complain when
gfs2_permission is called in non-RCU context:

    WARNING: suspicious RCU usage in gfs2_permission

Switch to rcu_dereference_check() and check for the MAY_NOT_BLOCK flag
to shut up lockdep when we know that dereferencing ip-&gt;i_gl is safe.

Fixes: 0abd1557e21c ("gfs2: fix an oops in gfs2_permission")
Reported-by: syzbot+3e5130844b0c0e2b4948@syzkaller.appspotmail.com
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 0abd1557e21c added rcu_dereference() for dereferencing ip-&gt;i_gl
in gfs2_permission.  This now causes lockdep to complain when
gfs2_permission is called in non-RCU context:

    WARNING: suspicious RCU usage in gfs2_permission

Switch to rcu_dereference_check() and check for the MAY_NOT_BLOCK flag
to shut up lockdep when we know that dereferencing ip-&gt;i_gl is safe.

Fixes: 0abd1557e21c ("gfs2: fix an oops in gfs2_permission")
Reported-by: syzbot+3e5130844b0c0e2b4948@syzkaller.appspotmail.com
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfs2: fs: derive f_fsid from s_uuid</title>
<updated>2023-11-06T00:51:26+00:00</updated>
<author>
<name>Amir Goldstein</name>
<email>amir73il@gmail.com</email>
</author>
<published>2023-10-24T07:55:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d6fc6c93636ffefd3d209d90a749e4e4ea51d6c1'/>
<id>d6fc6c93636ffefd3d209d90a749e4e4ea51d6c1</id>
<content type='text'>
gfs2 already has optional persistent uuid.

Use that uuid to report f_fsid in statfs(2), same as ext2/ext4/zonefs.

This allows gfs2 to be monitored by fanotify filesystem watch.
for example, with inotify-tools 4.23.8.0, the following command can be
used to watch changes over entire filesystem:

  fsnotifywatch --filesystem /mnt/gfs2

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gfs2 already has optional persistent uuid.

Use that uuid to report f_fsid in statfs(2), same as ext2/ext4/zonefs.

This allows gfs2 to be monitored by fanotify filesystem watch.
for example, with inotify-tools 4.23.8.0, the following command can be
used to watch changes over entire filesystem:

  fsnotifywatch --filesystem /mnt/gfs2

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfs2: No longer use 'extern' in function declarations</title>
<updated>2023-11-06T00:51:26+00:00</updated>
<author>
<name>Andreas Gruenbacher</name>
<email>agruenba@redhat.com</email>
</author>
<published>2023-10-09T16:49:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0b2355fe91ac3756a9e29c8b833ba33f9affb520'/>
<id>0b2355fe91ac3756a9e29c8b833ba33f9affb520</id>
<content type='text'>
For non-static function declarations, external linkage is implied and
the 'extern' keyword isn't needed.  Some static checkers complain about
the overuse of 'extern', so clean up all the function declarations.

In addition, remove 'extern' from the definition of
free_local_statfs_inodes(); it isn't needed there, either.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For non-static function declarations, external linkage is implied and
the 'extern' keyword isn't needed.  Some static checkers complain about
the overuse of 'extern', so clean up all the function declarations.

In addition, remove 'extern' from the definition of
free_local_statfs_inodes(); it isn't needed there, either.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfs2: Rename gfs2_lookup_{ simple =&gt; meta }</title>
<updated>2023-11-06T00:51:26+00:00</updated>
<author>
<name>Andreas Gruenbacher</name>
<email>agruenba@redhat.com</email>
</author>
<published>2023-07-26T20:23:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=062fb903895a035ed382a0d3f9b9d459b2718217'/>
<id>062fb903895a035ed382a0d3f9b9d459b2718217</id>
<content type='text'>
Function gfs2_lookup_simple() is used for looking up inodes in the
metadata directory tree, so rename it to gfs2_lookup_meta() to closer
match its purpose.  Clean the function up a little on the way.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Function gfs2_lookup_simple() is used for looking up inodes in the
metadata directory tree, so rename it to gfs2_lookup_meta() to closer
match its purpose.  Clean the function up a little on the way.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfs2: Convert gfs2_internal_read to folios</title>
<updated>2023-11-06T00:51:26+00:00</updated>
<author>
<name>Andreas Gruenbacher</name>
<email>agruenba@redhat.com</email>
</author>
<published>2023-07-24T18:53:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=be7f6a6b0bca708999eef4f8e9f2b128c73b9e17'/>
<id>be7f6a6b0bca708999eef4f8e9f2b128c73b9e17</id>
<content type='text'>
Change gfs2_internal_read() to use folios.  Convert sizes to size_t.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change gfs2_internal_read() to use folios.  Convert sizes to size_t.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gfs2: Convert stuffed_readpage to folios</title>
<updated>2023-11-06T00:51:25+00:00</updated>
<author>
<name>Andreas Gruenbacher</name>
<email>agruenba@redhat.com</email>
</author>
<published>2023-07-21T21:58:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7fa4964b35e4046cae1c7d8b42f631ffd898701d'/>
<id>7fa4964b35e4046cae1c7d8b42f631ffd898701d</id>
<content type='text'>
Change stuffed_readpage() to take a folio instead of a page.

Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change stuffed_readpage() to take a folio instead of a page.

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