public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Subject: [patch 13/22] nilfs2: fix preempt count underflow in nilfs_btnode_prepare_change_key
Date: Thu, 10 Sep 2009 17:22:59 -0700	[thread overview]
Message-ID: <20090911002410.971758034@mini.kroah.org> (raw)
In-Reply-To: <20090911002616.GA12087@kroah.com>

[-- Attachment #1: nilfs2-fix-preempt-count-underflow-in-nilfs_btnode_prepare_change_key.patch --]
[-- Type: text/plain, Size: 3758 bytes --]

2.6.30-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>

commit b1f1b8ce0a1d71cbc72f7540134d52b79bd8f5ac upstream.

This will fix the following preempt count underflow reported from
users with the title "[NILFS users] segctord problem" (Message-ID:
<949415.6494.qm@web58808.mail.re1.yahoo.com> and Message-ID:
<debc30fc0908270825v747c1734xa59126623cfd5b05@mail.gmail.com>):

 WARNING: at kernel/sched.c:4890 sub_preempt_count+0x95/0xa0()
 Hardware name: HP Compaq 6530b (KR980UT#ABC)
 Modules linked in: bridge stp llc bnep rfcomm l2cap xfs exportfs nilfs2 cowloop loop vboxnetadp vboxnetflt vboxdrv btusb bluetooth uvcvideo videodev v4l1_compat v4l2_compat_ioctl32 arc4 snd_hda_codec_analog ecb iwlagn iwlcore rfkill lib80211 mac80211 snd_hda_intel snd_hda_codec ehci_hcd uhci_hcd usbcore snd_hwdep snd_pcm tg3 cfg80211 psmouse snd_timer joydev libphy ohci1394 snd_page_alloc hp_accel lis3lv02d ieee1394 led_class i915 drm i2c_algo_bit video backlight output i2c_core dm_crypt dm_mod
 Pid: 4197, comm: segctord Not tainted 2.6.30-gentoo-r4-64 #7
 Call Trace:
  [<ffffffff8023fa05>] ? sub_preempt_count+0x95/0xa0
  [<ffffffff802470f8>] warn_slowpath_common+0x78/0xd0
  [<ffffffff8024715f>] warn_slowpath_null+0xf/0x20
  [<ffffffff8023fa05>] sub_preempt_count+0x95/0xa0
  [<ffffffffa04ce4db>] nilfs_btnode_prepare_change_key+0x11b/0x190 [nilfs2]
  [<ffffffffa04d01ad>] nilfs_btree_assign_p+0x19d/0x1e0 [nilfs2]
  [<ffffffffa04d10ad>] nilfs_btree_assign+0xbd/0x130 [nilfs2]
  [<ffffffffa04cead7>] nilfs_bmap_assign+0x47/0x70 [nilfs2]
  [<ffffffffa04d9bc6>] nilfs_segctor_do_construct+0x956/0x20f0 [nilfs2]
  [<ffffffff805ac8e2>] ? _spin_unlock_irqrestore+0x12/0x40
  [<ffffffff803c06e0>] ? __up_write+0xe0/0x150
  [<ffffffff80262959>] ? up_write+0x9/0x10
  [<ffffffffa04ce9f3>] ? nilfs_bmap_test_and_clear_dirty+0x43/0x60 [nilfs2]
  [<ffffffffa04cd627>] ? nilfs_mdt_fetch_dirty+0x27/0x60 [nilfs2]
  [<ffffffffa04db5fc>] nilfs_segctor_construct+0x8c/0xd0 [nilfs2]
  [<ffffffffa04dc3dc>] nilfs_segctor_thread+0x15c/0x3a0 [nilfs2]
  [<ffffffffa04dbe20>] ? nilfs_construction_timeout+0x0/0x10 [nilfs2]
  [<ffffffff80252633>] ? add_timer+0x13/0x20
  [<ffffffff802370da>] ? __wake_up_common+0x5a/0x90
  [<ffffffff8025e960>] ? autoremove_wake_function+0x0/0x40
  [<ffffffffa04dc280>] ? nilfs_segctor_thread+0x0/0x3a0 [nilfs2]
  [<ffffffffa04dc280>] ? nilfs_segctor_thread+0x0/0x3a0 [nilfs2]
  [<ffffffff8025e556>] kthread+0x56/0x90
  [<ffffffff8020cdea>] child_rip+0xa/0x20
  [<ffffffff8025e500>] ? kthread+0x0/0x90
  [<ffffffff8020cde0>] ? child_rip+0x0/0x20

This problem was caused due to a missing radix_tree_preload() call in
the retry path of nilfs_btnode_prepare_change_key() function.

Reported-by: Eric A <eric225125@yahoo.com>
Reported-by: Jerome Poulin <jeromepoulin@gmail.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Tested-by: Jerome Poulin <jeromepoulin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/nilfs2/btnode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/nilfs2/btnode.c
+++ b/fs/nilfs2/btnode.c
@@ -206,6 +206,7 @@ int nilfs_btnode_prepare_change_key(stru
 		 * We cannot call radix_tree_preload for the kernels older
 		 * than 2.6.23, because it is not exported for modules.
 		 */
+retry:
 		err = radix_tree_preload(GFP_NOFS & ~__GFP_HIGHMEM);
 		if (err)
 			goto failed_unlock;
@@ -216,7 +217,6 @@ int nilfs_btnode_prepare_change_key(stru
 				       (unsigned long long)oldkey,
 				       (unsigned long long)newkey);
 
-retry:
 		spin_lock_irq(&btnc->tree_lock);
 		err = radix_tree_insert(&btnc->page_tree, newkey, obh->b_page);
 		spin_unlock_irq(&btnc->tree_lock);



  parent reply	other threads:[~2009-09-11  0:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090911002246.666327880@mini.kroah.org>
2009-09-11  0:26 ` [patch 00/22] 2.6.30.7-stable review Greg KH
2009-09-11  0:22   ` [patch 01/22] dccp: missing destroy of percpu counter variable while unload module Greg KH
2009-09-11  0:22   ` [patch 02/22] E100: fix interaction with swiotlb on X86 Greg KH
2009-09-11  0:22   ` [patch 03/22] gre: Fix MTU calculation for bound GRE tunnels Greg KH
2009-09-11  0:22   ` [patch 04/22] ppp: fix lost fragments in ppp_mp_explode() (resubmit) Greg KH
2009-09-11  0:22   ` [patch 05/22] pppol2tp: calls unregister_pernet_gen_device() at unload time Greg KH
2009-09-11  0:22   ` [patch 06/22] net: net_assign_generic() fix Greg KH
2009-09-11  0:22   ` [patch 07/22] sparc64: Kill spurious NMI watchdog triggers by increasing limit to 30 seconds Greg KH
2009-09-11  0:22   ` [patch 08/22] sparc64: Validate linear D-TLB misses Greg KH
2009-09-11  0:22   ` [patch 09/22] sparc64: Fix bootup with mcount in some configs Greg KH
2009-09-11  0:22   ` [patch 10/22] sparc: sys32.S incorrect compat-layer splice() system call Greg KH
2009-09-11  0:22   ` [patch 11/22] JFFS2: add missing verify buffer allocation/deallocation Greg KH
2009-09-11  0:22   ` [patch 12/22] slub: Fix kmem_cache_destroy() with SLAB_DESTROY_BY_RCU Greg KH
2009-09-11  0:22   ` Greg KH [this message]
2009-09-11  0:23   ` [patch 14/22] PCI SR-IOV: correct broken resource alignment calculations Greg KH
2009-09-11  0:23   ` [patch 15/22] SCSI: sd: fix bug in SCSI async probing Greg KH
2009-09-11  0:23   ` [patch 16/22] sound: oxygen: handle cards with missing EEPROM Greg KH
2009-09-11  0:23   ` [patch 17/22] sound: oxygen: fix MCLK rate for 192 kHz playback Greg KH
2009-09-11  0:23   ` [patch 18/22] dm raid1: do not allow log_failure variable to unset after being set Greg KH
2009-09-11  0:23   ` [patch 19/22] dm snapshot: refactor zero_disk_area to use chunk_io Greg KH
2009-09-11  0:23   ` [patch 20/22] dm snapshot: fix header corruption race on invalidation Greg KH
2009-09-11  0:23   ` [patch 21/22] dm exception store: split set_chunk_size Greg KH
2009-09-11  0:23   ` [patch 22/22] dm snapshot: fix on disk chunk size validation Greg KH
2009-09-11  5:19   ` [patch 00/22] 2.6.30.7-stable review Dmitry Torokhov
2009-09-11 15:31     ` [stable] " Greg KH

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=20090911002410.971758034@mini.kroah.org \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=konishi.ryusuke@lab.ntt.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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