<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/jbd2.h, branch v5.15.80</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.15.80</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.15.80'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-03-08T18:12:32Z</updated>
<entry>
<title>ext4: fast commit may not fallback for ineligible commit</title>
<updated>2022-03-08T18:12:32Z</updated>
<author>
<name>Xin Yin</name>
<email>yinxin.x@bytedance.com</email>
</author>
<published>2022-01-17T09:36:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=97abcfedc87cb501071e8947184ee0c5acca6874'/>
<id>urn:sha1:97abcfedc87cb501071e8947184ee0c5acca6874</id>
<content type='text'>
[ Upstream commit e85c81ba8859a4c839bcd69c5d83b32954133a5b ]

For the follow scenario:
1. jbd start commit transaction n
2. task A get new handle for transaction n+1
3. task A do some ineligible actions and mark FC_INELIGIBLE
4. jbd complete transaction n and clean FC_INELIGIBLE
5. task A call fsync

In this case fast commit will not fallback to full commit and
transaction n+1 also not handled by jbd.

Make ext4_fc_mark_ineligible() also record transaction tid for
latest ineligible case, when call ext4_fc_cleanup() check
current transaction tid, if small than latest ineligible tid
do not clear the EXT4_MF_FC_INELIGIBLE.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reported-by: Ritesh Harjani &lt;riteshh@linux.ibm.com&gt;
Suggested-by: Harshad Shirwadkar &lt;harshadshirwadkar@gmail.com&gt;
Signed-off-by: Xin Yin &lt;yinxin.x@bytedance.com&gt;
Link: https://lore.kernel.org/r/20220117093655.35160-2-yinxin.x@bytedance.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Cc: stable@kernel.org
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ext4: inline jbd2_journal_[un]register_shrinker()</title>
<updated>2021-07-08T12:37:31Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2021-07-02T22:05:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0705e8d1e2207ceeb83dc6e1751b6b82718b353a'/>
<id>urn:sha1:0705e8d1e2207ceeb83dc6e1751b6b82718b353a</id>
<content type='text'>
The function jbd2_journal_unregister_shrinker() was getting called
twice when the file system was getting unmounted.  On Power and ARM
platforms this was causing kernel crash when unmounting the file
system, when a percpu_counter was destroyed twice.

Fix this by removing jbd2_journal_[un]register_shrinker() functions,
and inlining the shrinker setup and teardown into
journal_init_common() and jbd2_journal_destroy().  This means that
ext4 and ocfs2 now no longer need to know about registering and
unregistering jbd2's shrinker.

Also, while we're at it, rename the percpu counter from
j_jh_shrink_count to j_checkpoint_jh_count, since this makes it
clearer what this counter is intended to track.

Link: https://lore.kernel.org/r/20210705145025.3363130-1-tytso@mit.edu
Fixes: 4ba3fcdde7e3 ("jbd2,ext4: add a shrinker to release checkpointed buffers")
Reported-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Reported-by: Sachin Sant &lt;sachinp@linux.vnet.ibm.com&gt;
Tested-by: Sachin Sant &lt;sachinp@linux.vnet.ibm.com&gt;
Tested-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>jbd2,ext4: add a shrinker to release checkpointed buffers</title>
<updated>2021-06-24T14:54:49Z</updated>
<author>
<name>Zhang Yi</name>
<email>yi.zhang@huawei.com</email>
</author>
<published>2021-06-10T11:24:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4ba3fcdde7e36af93610ceb3cc38365b14539865'/>
<id>urn:sha1:4ba3fcdde7e36af93610ceb3cc38365b14539865</id>
<content type='text'>
Current metadata buffer release logic in bdev_try_to_free_page() have
a lot of use-after-free issues when umount filesystem concurrently, and
it is difficult to fix directly because ext4 is the only user of
s_op-&gt;bdev_try_to_free_page callback and we may have to add more special
refcount or lock that is only used by ext4 into the common vfs layer,
which is unacceptable.

One better solution is remove the bdev_try_to_free_page callback, but
the real problem is we cannot easily release journal_head on the
checkpointed buffer, so try_to_free_buffers() cannot release buffers and
page under memory pressure, which is more likely to trigger
out-of-memory. So we cannot remove the callback directly before we find
another way to release journal_head.

This patch introduce a shrinker to free journal_head on the checkpointed
transaction. After the journal_head got freed, try_to_free_buffers()
could free buffer properly.

Signed-off-by: Zhang Yi &lt;yi.zhang@huawei.com&gt;
Suggested-by: Jan Kara &lt;jack@suse.cz&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Link: https://lore.kernel.org/r/20210610112440.3438139-6-yi.zhang@huawei.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>jbd2: ensure abort the journal if detect IO error when writing original buffer back</title>
<updated>2021-06-24T14:33:49Z</updated>
<author>
<name>Zhang Yi</name>
<email>yi.zhang@huawei.com</email>
</author>
<published>2021-06-10T11:24:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fcf37549ae19e904bc6a5eadf5c25eca36100c5e'/>
<id>urn:sha1:fcf37549ae19e904bc6a5eadf5c25eca36100c5e</id>
<content type='text'>
Although we merged c044f3d8360 ("jbd2: abort journal if free a async
write error metadata buffer"), there is a race between
jbd2_journal_try_to_free_buffers() and jbd2_journal_destroy(), so the
jbd2_log_do_checkpoint() may still fail to detect the buffer write
io error flag which may lead to filesystem inconsistency.

jbd2_journal_try_to_free_buffers()     ext4_put_super()
                                        jbd2_journal_destroy()
  __jbd2_journal_remove_checkpoint()
  detect buffer write error              jbd2_log_do_checkpoint()
                                         jbd2_cleanup_journal_tail()
                                           &lt;--- lead to inconsistency
  jbd2_journal_abort()

Fix this issue by introducing a new atomic flag which only have one
JBD2_CHECKPOINT_IO_ERROR bit now, and set it in
__jbd2_journal_remove_checkpoint() when freeing a checkpoint buffer
which has write_io_error flag. Then jbd2_journal_destroy() will detect
this mark and abort the journal to prevent updating log tail.

Signed-off-by: Zhang Yi &lt;yi.zhang@huawei.com&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Link: https://lore.kernel.org/r/20210610112440.3438139-3-yi.zhang@huawei.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: add discard/zeroout flags to journal flush</title>
<updated>2021-06-22T23:27:10Z</updated>
<author>
<name>Leah Rumancik</name>
<email>leah.rumancik@gmail.com</email>
</author>
<published>2021-05-18T15:13:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=01d5d96542fd4e383da79593f8a3450995ce2257'/>
<id>urn:sha1:01d5d96542fd4e383da79593f8a3450995ce2257</id>
<content type='text'>
Add a flags argument to jbd2_journal_flush to enable discarding or
zero-filling the journal blocks while flushing the journal.

Signed-off-by: Leah Rumancik &lt;leah.rumancik@gmail.com&gt;
Link: https://lore.kernel.org/r/20210518151327.130198-1-leah.rumancik@gmail.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>jbd2: avoid -Wempty-body warnings</title>
<updated>2021-04-06T02:39:38Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2021-03-22T10:21:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d556435156b7970b8ce61b355df558a5168927cc'/>
<id>urn:sha1:d556435156b7970b8ce61b355df558a5168927cc</id>
<content type='text'>
Building with 'make W=1' shows a harmless -Wempty-body warning:

fs/jbd2/recovery.c: In function 'fc_do_one_pass':
fs/jbd2/recovery.c:267:75: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  267 |                 jbd_debug(3, "Fast commit replay failed, err = %d\n", err);
      |                                                                           ^

Change the empty dprintk() macros to no_printk(), which avoids this
warning and adds format string checking.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Link: https://lore.kernel.org/r/20210322102152.95684-1-arnd@kernel.org
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>Updated locking documentation for transaction_t</title>
<updated>2021-04-02T15:37:58Z</updated>
<author>
<name>Alexander Lochmann</name>
<email>alexander.lochmann@tu-dortmund.de</email>
</author>
<published>2021-02-11T17:14:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3042b1b45c4106feff063932d4fd481c5009dbe1'/>
<id>urn:sha1:3042b1b45c4106feff063932d4fd481c5009dbe1</id>
<content type='text'>
Some members of transaction_t are allowed to be read without any lock
being held if accessed from the correct context.  We used LockDoc's
findings to determine those members.  Each member of them is marked
with a short comment: "no lock needed for jbd2 thread".

Signed-off-by: Alexander Lochmann &lt;alexander.lochmann@tu-dortmund.de&gt;
Signed-off-by: Horst Schirmeier &lt;horst.schirmeier@tu-dortmund.de&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Link: https://lore.kernel.org/r/20210211171410.17984-1-alexander.lochmann@tu-dortmund.de
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: updated locking documentation for journal_t</title>
<updated>2021-04-02T15:37:58Z</updated>
<author>
<name>Alexander Lochmann</name>
<email>alexander.lochmann@tu-dortmund.de</email>
</author>
<published>2021-02-11T09:51:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d699ae4fc27496d01e8bc5ab2106bd79d1e7be92'/>
<id>urn:sha1:d699ae4fc27496d01e8bc5ab2106bd79d1e7be92</id>
<content type='text'>
Some members of transaction_t are allowed to be read without any lock
being held if consistency doesn't matter.  Based on LockDoc's
findings, we extended the locking documentation of those members.
Each one of them is marked with a short comment: "no lock for quick
racy checks".

Signed-off-by: Alexander Lochmann &lt;alexander.lochmann@tu-dortmund.de&gt;
Signed-off-by: Horst Schirmeier &lt;horst.schirmeier@tu-dortmund.de&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Link: https://lore.kernel.org/r/ad82c7a9-a624-4ed5-5ada-a6410c44c0b3@tu-dortmund.de
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>jbd2: add a helper to find out number of fast commit blocks</title>
<updated>2020-12-17T18:30:45Z</updated>
<author>
<name>Harshad Shirwadkar</name>
<email>harshadshirwadkar@gmail.com</email>
</author>
<published>2020-11-20T20:22:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9bd23c31f392bda88618008f27fd52ee9e0fac38'/>
<id>urn:sha1:9bd23c31f392bda88618008f27fd52ee9e0fac38</id>
<content type='text'>
Add a helper to read number of fast commit blocks from jbd2 superblock
and also rename the JBD2_MIN_FC_BLKS to
JBD2_DEFAULT_FAST_COMMIT_BLOCKS since this constant is just the
default number of fast commit blocks to use in case number of fast
commit blocks isn't set in jbd2 superblock.

Signed-off-by: Harshad Shirwadkar &lt;harshadshirwadkar@gmail.com&gt;
Link: https://lore.kernel.org/r/20201120202232.2240293-2-harshadshirwadkar@gmail.com
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>Updated locking documentation for transaction_t</title>
<updated>2020-12-03T14:00:55Z</updated>
<author>
<name>Alexander Lochmann</name>
<email>alexander.lochmann@tu-dortmund.de</email>
</author>
<published>2020-10-15T13:24:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=50a4952fd67b7f7f551e82ac07c51c1a7a74d474'/>
<id>urn:sha1:50a4952fd67b7f7f551e82ac07c51c1a7a74d474</id>
<content type='text'>
We used LockDoc to derive locking rules for each member
of struct transaction_t.
Based on those results, we extended the existing documentation
by more members of struct transaction_t, and updated the existing
documentation.

Link: https://lore.kernel.org/r/10cfbef1-994c-c604-f8a6-b1042fcc622f@tu-dortmund.de
Signed-off-by: Alexander Lochmann &lt;alexander.lochmann@tu-dortmund.de&gt;
Signed-off-by: Horst Schirmeier &lt;horst.schirmeier@tu-dortmund.de&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
</feed>
