Go to file
Josef Bacik 5aa2717b6b btrfs: fix error handling in commit_fs_roots
[ Upstream commit 4f4317c13a40194940acf4a71670179c4faca2b5 ]

While doing error injection I would sometimes get a corrupt file system.
This is because I was injecting errors at btrfs_search_slot, but would
only do it one time per stack.  This uncovered a problem in
commit_fs_roots, where if we get an error we would just break.  However
we're in a nested loop, the first loop being a loop to find all the
dirty fs roots, and then subsequent root updates would succeed clearing
the error value.

This isn't likely to happen in real scenarios, however we could
potentially get a random ENOMEM once and then not again, and we'd end up
with a corrupted file system.  Fix this by moving the error checking
around a bit to the main loop, as this is the only place where something
will fail, and return the error as soon as it occurs.

With this patch my reproducer no longer corrupts the file system.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-07 12:34:13 +01:00
arch x86/reboot: Add Zotac ZBOX CI327 nano PCI reboot quirk 2021-03-07 12:34:09 +01:00
block blk-settings: align max_sectors on "logical_block_size" boundary 2021-03-04 11:38:22 +01:00
certs
crypto crypto: tcrypt - avoid signed overflow in byte count 2021-03-07 12:34:11 +01:00
Documentation dt-bindings: net: btusb: DT fix s/interrupt-name/interrupt-names/ 2021-03-07 12:34:08 +01:00
drivers nvme-tcp: add clean action for failed reconnection 2021-03-07 12:34:12 +01:00
fs btrfs: fix error handling in commit_fs_roots 2021-03-07 12:34:13 +01:00
include Bluetooth: Add new HCI_QUIRK_NO_SUSPEND_NOTIFIER quirk 2021-03-07 12:34:10 +01:00
init kgdb: fix to kill breakpoints on initmem after boot 2021-03-04 11:38:46 +01:00
ipc
kernel sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled 2021-03-07 12:34:04 +01:00
lib
LICENSES
mm mm/hugetlb.c: fix unnecessary address expansion of pmd sharing 2021-03-07 12:34:06 +01:00
net Bluetooth: Fix null pointer dereference in amp_read_loc_assoc_final_data 2021-03-07 12:34:10 +01:00
samples
scripts
security tomoyo: ignore data race while checking quota 2021-03-07 12:34:05 +01:00
sound ASoC: Intel: Add DMI quirk table to soc_intel_is_byt_cr() 2021-03-07 12:34:13 +01:00
tools wireguard: selftests: test multiple parallel streams 2021-03-04 11:38:47 +01:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.10.20 2021-03-04 11:38:47 +01:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.