From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, "Theodore Tso" <tytso@mit.edu>,
ocfs2-devel@oss.oracle.com, Joel Becker <jlbec@evilplan.org>
Subject: [PATCH 3.4 37/43] jbd2: dont BUG but return ENOSPC if a handle runs out of space
Date: Mon, 6 Jan 2014 14:39:54 -0800 [thread overview]
Message-ID: <20140106223943.310249326@linuxfoundation.org> (raw)
In-Reply-To: <20140106223942.259651490@linuxfoundation.org>
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <tytso@mit.edu>
commit f6c07cad081ba222d63623d913aafba5586c1d2c upstream.
If a handle runs out of space, we currently stop the kernel with a BUG
in jbd2_journal_dirty_metadata(). This makes it hard to figure out
what might be going on. So return an error of ENOSPC, so we can let
the file system layer figure out what is going on, to make it more
likely we can get useful debugging information). This should make it
easier to debug problems such as the one which was reported by:
https://bugzilla.kernel.org/show_bug.cgi?id=44731
The only two callers of this function are ext4_handle_dirty_metadata()
and ocfs2_journal_dirty(). The ocfs2 function will trigger a
BUG_ON(), which means there will be no change in behavior. The ext4
function will call ext4_error_inode() which will print the useful
debugging information and then handle the situation using ext4's error
handling mechanisms (i.e., which might mean halting the kernel or
remounting the file system read-only).
Also, since both file systems already call WARN_ON(), drop the WARN_ON
from jbd2_journal_dirty_metadata() to avoid two stack traces from
being displayed.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: ocfs2-devel@oss.oracle.com
Acked-by: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/jbd2/transaction.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -1126,7 +1126,10 @@ int jbd2_journal_dirty_metadata(handle_t
* once a transaction -bzzz
*/
jh->b_modified = 1;
- J_ASSERT_JH(jh, handle->h_buffer_credits > 0);
+ if (handle->h_buffer_credits <= 0) {
+ ret = -ENOSPC;
+ goto out_unlock_bh;
+ }
handle->h_buffer_credits--;
}
@@ -1209,7 +1212,6 @@ out_unlock_bh:
jbd2_journal_put_journal_head(jh);
out:
JBUFFER_TRACE(jh, "exit");
- WARN_ON(ret); /* All errors are bugs, so dump the stack */
return ret;
}
next prev parent reply other threads:[~2014-01-06 22:39 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-06 22:39 [PATCH 3.4 00/43] 3.4.76-stable review Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 01/43] USB: serial: fix race in generic write Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 02/43] ceph: cleanup aborted requests when re-sending requests Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 03/43] ceph: wake up safe waiters when unregistering request Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 04/43] powerpc: kvm: fix rare but potential deadlock scene Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 05/43] TTY: pmac_zilog, check existence of ports in pmz_console_init() Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 06/43] ASoC: wm8904: fix DSP mode B configuration Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 07/43] ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail function Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 09/43] selinux: fix broken peer recv check Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 10/43] selinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock() Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 11/43] ftrace: Initialize the ftrace profiler for each possible cpu Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 12/43] intel_idle: initial IVB support Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 13/43] intel_idle: enable IVB Xeon support Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 14/43] ext4: fix use-after-free in ext4_mb_new_blocks Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 16/43] sched/rt: Fix rqs cpupri leak while enqueue/dequeue child RT entities Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 18/43] net_dma: mark broken Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 19/43] drm/radeon: fix asic gfx values for scrapper asics Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 20/43] drm/radeon: 0x9649 is SUMO2 not SUMO Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 21/43] ceph: Avoid data inconsistency due to d-cache aliasing in readpage() Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 22/43] tg3: Expand 4g_overflow_test workaround to skb fragments of any size Greg Kroah-Hartman
2014-01-06 22:58 ` Eric Dumazet
2014-01-06 23:05 ` Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 23/43] dm9601: fix reception of full size ethernet frames on dm9620/dm9621a Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 24/43] dm9601: work around tx fifo sync issue on dm962x Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 25/43] ath9k: Fix interrupt handling for the AR9002 family Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 26/43] ath9k_htc: properly set MAC address and BSSID mask Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 27/43] powerpc: Fix bad stack check in exception entry Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 28/43] powerpc: Align p_end Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 29/43] cpupower: Fix segfault due to incorrect getopt_long arugments Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 30/43] libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8 Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 31/43] radiotap: fix bitmap-end-finding buffer overrun Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 32/43] rtlwifi: pci: Fix oops on driver unload Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 33/43] mm/hugetlb: check for pte NULL pointer in __page_check_address() Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 34/43] Input: allocate absinfo data when setting ABS capability Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 35/43] GFS2: dont hold s_umount over blkdev_put Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 36/43] GFS2: Fix incorrect invalidation for DIO/buffered I/O Greg Kroah-Hartman
2014-01-06 22:39 ` Greg Kroah-Hartman [this message]
2014-01-06 22:39 ` [PATCH 3.4 38/43] gpio: msm: Fix irq mask/unmask by writing bits instead of numbers Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 39/43] sched: Avoid throttle_cfs_rq() racing with period_timer stopping Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 40/43] sh: always link in helper functions extracted from libgcc Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 41/43] selinux: look for IPsec labels on both inbound and outbound packets Greg Kroah-Hartman
2014-01-06 22:39 ` [PATCH 3.4 42/43] selinux: process labeled IPsec TCP SYN-ACK packets properly in selinux_ip_postroute() Greg Kroah-Hartman
2014-01-06 22:40 ` [PATCH 3.4 43/43] hwmon: (w83l768ng) Fix fan speed control range Greg Kroah-Hartman
2014-01-07 5:01 ` [PATCH 3.4 00/43] 3.4.76-stable review Guenter Roeck
2014-01-07 15:22 ` Greg Kroah-Hartman
2014-01-07 19:09 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140106223943.310249326@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ocfs2-devel@oss.oracle.com \
--cc=stable@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).