linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <zbr@ioremap.net>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Kernel Testers List <kernel-testers@vger.kernel.org>,
	Alexander Beregalov <a.beregalov@gmail.com>
Subject: Re: [Bug #14894] pohmelfs: NULL pointer dereference
Date: Wed, 6 Jan 2010 23:00:37 +0300	[thread overview]
Message-ID: <20100106200037.GA17641@ioremap.net> (raw)
In-Reply-To: <20091230091433.GU4489@kernel.dk>

Hi Jens.

Thanks a lot for your patch, it looks good, but I'm not able to check it
right now - its new year holidays here, that's also why reply is too late :)
I will try it in a week and report back.

On Wed, Dec 30, 2009 at 10:14:34AM +0100, Jens Axboe (jens.axboe@oracle.com) wrote:
> On Tue, Dec 29 2009, Rafael J. Wysocki wrote:
> > On Tuesday 29 December 2009, Evgeniy Polyakov wrote:
> > > On Tue, Dec 29, 2009 at 04:28:52PM +0100, Rafael J. Wysocki (rjw@sisk.pl) wrote:
> > > > This message has been generated automatically as a part of a report
> > > > of regressions introduced between 2.6.31 and 2.6.32.
> > > > 
> > > > The following bug entry is on the current list of known regressions
> > > > introduced between 2.6.31 and 2.6.32.  Please verify if it still should
> > > > be listed and let me know (either way).
> > > > 
> > > > 
> > > > Bug-Entry	: http://bugzilla.kernel.org/show_bug.cgi?id=14894
> > > > Subject		: pohmelfs: NULL pointer dereference
> > > > Submitter	: Alexander Beregalov <a.beregalov@gmail.com>
> > > > Date		: 2009-12-02 1:11 (28 days old)
> > > > References	: http://marc.info/?l=linux-kernel&m=125971633107940&w=4
> > > > Handled-By	: Evgeniy Polyakov <zbr@ioremap.net>
> > > 
> > > Yes, I saw this regression and there is a patch to handle this, but it
> > > kind of disables sync at all. Jens Axboe, who introduced per-bdi
> > > writeback patches, did not yet reply.
> > 
> > Well, Jens, what's your opinion about that?
> 
> Since pohmelfs isn't tied to a single block device, it needs to setup a
> backing dev like nfs/btrfs/etc do. Here's a completely untested patch.
> 
> diff --git a/drivers/staging/pohmelfs/inode.c b/drivers/staging/pohmelfs/inode.c
> index f69b778..cd25811 100644
> --- a/drivers/staging/pohmelfs/inode.c
> +++ b/drivers/staging/pohmelfs/inode.c
> @@ -36,6 +36,7 @@
>  #define POHMELFS_MAGIC_NUM	0x504f482e
>  
>  static struct kmem_cache *pohmelfs_inode_cache;
> +static atomic_t psb_bdi_num = ATOMIC_INIT(0);
>  
>  /*
>   * Removes inode from all trees, drops local name cache and removes all queued
> @@ -1331,6 +1332,8 @@ static void pohmelfs_put_super(struct super_block *sb)
>  	pohmelfs_crypto_exit(psb);
>  	pohmelfs_state_exit(psb);
>  
> +	bdi_destroy(&psb->bdi);
> +
>  	kfree(psb);
>  	sb->s_fs_info = NULL;
>  }
> @@ -1815,11 +1818,22 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
>  	if (!psb)
>  		goto err_out_exit;
>  
> +	err = bdi_init(&psb->bdi);
> +	if (err)
> +		goto err_out_free_sb;
> +
> +	err = bdi_register(&psb->bdi, NULL, "pfs-%d", atomic_inc_return(&psb_bdi_num));
> +	if (err) {
> +		bdi_destroy(&psb->bdi);
> +		goto err_out_free_sb;
> +	}
> +
>  	sb->s_fs_info = psb;
>  	sb->s_op = &pohmelfs_sb_ops;
>  	sb->s_magic = POHMELFS_MAGIC_NUM;
>  	sb->s_maxbytes = MAX_LFS_FILESIZE;
>  	sb->s_blocksize = PAGE_SIZE;
> +	sb->s_bdi = &psb->bdi;
>  
>  	psb->sb = sb;
>  
> @@ -1863,11 +1877,11 @@ static int pohmelfs_fill_super(struct super_block *sb, void *data, int silent)
>  
>  	err = pohmelfs_parse_options((char *) data, psb, 0);
>  	if (err)
> -		goto err_out_free_sb;
> +		goto err_out_free_bdi;
>  
>  	err = pohmelfs_copy_crypto(psb);
>  	if (err)
> -		goto err_out_free_sb;
> +		goto err_out_free_bdi;
>  
>  	err = pohmelfs_state_init(psb);
>  	if (err)
> @@ -1916,6 +1930,8 @@ err_out_state_exit:
>  err_out_free_strings:
>  	kfree(psb->cipher_string);
>  	kfree(psb->hash_string);
> +err_out_free_bdi:
> +	bdi_destroy(&psb->bdi);
>  err_out_free_sb:
>  	kfree(psb);
>  err_out_exit:
> diff --git a/drivers/staging/pohmelfs/netfs.h b/drivers/staging/pohmelfs/netfs.h
> index 623a07d..01cba00 100644
> --- a/drivers/staging/pohmelfs/netfs.h
> +++ b/drivers/staging/pohmelfs/netfs.h
> @@ -18,6 +18,7 @@
>  
>  #include <linux/types.h>
>  #include <linux/connector.h>
> +#include <linux/backing-dev.h>
>  
>  #define POHMELFS_CN_IDX			5
>  #define POHMELFS_CN_VAL			0
> @@ -624,6 +625,8 @@ struct pohmelfs_sb {
>  
>  	struct super_block	*sb;
>  
> +	struct backing_dev_info	bdi;
> +
>  	/*
>  	 * Algorithm strings.
>  	 */
> 
> -- 
> Jens Axboe

-- 
	Evgeniy Polyakov

  reply	other threads:[~2010-01-06 20:00 UTC|newest]

Thread overview: 127+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-29 15:26 2.6.33-rc2: Reported regressions 2.6.31 -> 2.6.32 Rafael J. Wysocki
2009-12-29 15:26 ` [Bug #14297] console resume broken since ba15ab0e8d Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14298] warning at manage.c:361 (set_irq_wake), matrix-keypad related? Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14331] Radeon XPRESS 200M: System hang with radeon DRI and Fedora 10 userspace unless DRI=off Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14376] Kernel NULL pointer dereference/ kvm subsystem Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14406] uvcvideo stopped work on Toshiba Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14442] resume after hibernate: /dev/sdb drops and returns as /dev/sde Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14436] Computer becomes unusable without any apparent reason Rafael J. Wysocki
2009-12-29 16:18   ` Luís Picciochi Oliveira
2009-12-29 22:04     ` Rafael J. Wysocki
2009-12-29 22:32       ` Luís Picciochi Oliveira
2009-12-29 15:28 ` [Bug #14417] [Regression] Wireless driver iwlagn+iwlcore doesn't work after resume (needs reloading) Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14426] CE: hpet increasing min_delta_ns flood Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14485] System lockup running "cat /sys/kernel/debug/dri/0/i915_regs" Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14483] Interrupts enabled after irqrouter_resume - iMac9,1 Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14482] kernel BUG at fs/dcache.c:670 +lvm +md +ext3 Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14487] PANIC: early exception 08 rip 246:10 error ffffffff810251b5 cr2 0 Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14504] intermittent hibernation problem again Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14538] Unable to associate with AP after resume since 2.6.32-rc6 Rafael J. Wysocki
2009-12-29 15:42   ` Larry Finger
2009-12-29 15:28 ` [Bug #14624] ath9k: BUG kmalloc-8192: Poison overwritten Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14621] specjbb2005 and aim7 regression with 2.6.32-rc kernels Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14630] sched_rt_periodic_timer vs cpu hotplug Rafael J. Wysocki
2009-12-29 16:36   ` Peter Zijlstra
2009-12-29 21:22     ` Rafael J. Wysocki
2009-12-30  8:18     ` Heiko Carstens
2009-12-30 21:29       ` Rafael J. Wysocki
2009-12-31  9:59         ` Heiko Carstens
2010-01-04 23:08           ` [stable] " Greg KH
2009-12-29 15:28 ` [Bug #14627] i915: *ERROR* Execbuf while wedged Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14625] Commit d451564 breaks ARM Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14656] Oops at __rmqueue+0x98 with 2.6.32-rc6 Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14657] perf subsystem breakage in 2.6.32-rc7 Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14655] swapper generated call trace " Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14667] bisected 2.6.32 regression - Temperatures not correctly detected after suspend - Dell Studio XPS 16 laptop Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14730] sky2 won't work after suspend/resume cycle Rafael J. Wysocki
2009-12-29 18:41   ` OGAWA Hirofumi
2009-12-29 21:29     ` Rafael J. Wysocki
2009-12-29 22:08       ` OGAWA Hirofumi
2009-12-29 22:41         ` Rafael J. Wysocki
2009-12-29 23:16           ` OGAWA Hirofumi
2009-12-29 23:40             ` Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14670] i915: playing video via XVideo extension makes the screen flicker Rafael J. Wysocki
2009-12-29 21:02   ` Thomas Meyer
2009-12-29 22:38     ` Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14728] Graphic corruption Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14727] livelock in futex_wait_setup Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14742] 2.6.32 new menu idle governor causes very high CPU temp Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14731] rt61pci regression Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14743] New rtl8187 rfkill support prevents using wlan completely Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14740] battery status info dissapears in 2.6.32 - MSI PR200 Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14783] Unhandled IRQ on Thinkpad R61i: "irq 16: nobody cared" Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14781] 181a533 is causing severe screen flickering on 965GM Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14782] Suspend hangs Lenovo SL300 after gdm login Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14748] e1000e NIC not working after reboot Rafael J. Wysocki
2010-01-04 13:43   ` Maciej Sitarz
2010-01-04 20:13     ` Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14817] When is system under load, then freeze/HD fail Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14840] X11 screen black after resume, only mouse pounter is seen Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14794] IP address assigned by DHCP is dropped after ~40 seconds Rafael J. Wysocki
2009-12-29 15:44   ` Mike Galbraith
2009-12-29 22:07     ` Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14786] Regression in 9f15226e7 (x86, ucode-amd: Ensure ucode update on suspend/resume after CPU off/online cycle) Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14841] unable to enumerate USB device on port X after suspend/resume Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14888] 2.6.32-rc8 shuts down after reaching critical temperature - thinkpad T500 Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14862] intel-agp breaks X, regression from 2.6.31 Rafael J. Wysocki
2009-12-29 18:42   ` Zephaniah E. Hull
2009-12-29 18:59     ` Zephaniah E. Hull
2009-12-29 21:34       ` Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14893] Tasks stuck on I/O on armel with 2.6.32-rc8 Rafael J. Wysocki
2010-01-05  1:34   ` Daniel Kahn Gillmor
2010-01-05 21:30     ` Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14891] Deadlock regression related to NFS root Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14889] System wakeup by time not working anymore Rafael J. Wysocki
2009-12-29 17:36   ` OGAWA Hirofumi
2009-12-29 21:35     ` Rafael J. Wysocki
2009-12-29 22:14       ` OGAWA Hirofumi
2009-12-30  8:56     ` Malte Schröder
2009-12-30  9:18       ` OGAWA Hirofumi
2009-12-29 15:28 ` [Bug #14894] pohmelfs: NULL pointer dereference Rafael J. Wysocki
2009-12-29 16:35   ` Evgeniy Polyakov
2009-12-29 21:37     ` Rafael J. Wysocki
2009-12-30  9:14       ` Jens Axboe
2010-01-06 20:00         ` Evgeniy Polyakov [this message]
2010-02-02 20:57         ` Evgeniy Polyakov
2010-02-02 21:18           ` Greg KH
2010-02-02 22:04             ` Evgeniy Polyakov
2010-02-02 22:20               ` Jens Axboe
2010-02-02 22:29                 ` Greg KH
2010-02-02 21:21           ` Rafael J. Wysocki
2010-02-02 23:44             ` Evgeniy Polyakov
2009-12-29 15:28 ` [Bug #14892] intel, KMS, suspend2ram resume, screen black Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14898] ksoftirqd problem Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14895] BUG in kernel 2.6.32 when using luks encrypted root and RAID0 Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14896] REGRESSION for RT2561/RT61 in 2.6.32, related to power saving Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14897] i915: Commit 0e442c60 causes flickering Rafael J. Wysocki
2009-12-30  6:22   ` David John
2009-12-30 21:35     ` Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14903] Kernel panic - not syncing: Attempted to kill init! Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14922] 2.6.32 seemed to have broken nVidia MCP7A sata controller Rafael J. Wysocki
2009-12-29 17:15   ` Robert Hancock
2009-12-29 15:28 ` [Bug #14905] kernel BUG at kernel/timer.c:951! Rafael J. Wysocki
2009-12-29 18:35   ` Jarek Poplawski
2009-12-29 21:39     ` Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14902] Boot ends not on tty1 Rafael J. Wysocki
2010-01-05  8:57   ` Andreas Friedrich
2010-01-05 21:32     ` Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14926] ucc_geth broken Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14933] OOM killer unexpectedly called Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14939] drm: random hang with i915 Rafael J. Wysocki
2009-12-29 15:28 ` [Bug #14943] nfs regression? Rafael J. Wysocki
2009-12-29 18:33   ` Nikola Ciprich
2009-12-29 21:47     ` Rafael J. Wysocki
2009-12-29 15:47 ` 2.6.33-rc2: Reported regressions 2.6.31 -> 2.6.32 Gertjan van Wingerde
2009-12-29 22:15   ` Rafael J. Wysocki
2009-12-29 19:42 ` Jarek Poplawski
2009-12-29 20:55   ` Németh Márton
2009-12-29 22:00     ` Jarek Poplawski
2009-12-29 21:49   ` Rafael J. Wysocki
2009-12-30 16:58 ` Larry Finger
  -- strict thread matches above, loose matches on Subject: below --
2010-01-10 22:45 2.6.33-rc3-git3: " Rafael J. Wysocki
2010-01-10 22:56 ` [Bug #14894] pohmelfs: NULL pointer dereference Rafael J. Wysocki
2010-01-10 23:23   ` Evgeniy Polyakov
2010-01-11 19:50     ` Rafael J. Wysocki
2010-01-24 22:15 2.6.33-rc5: Reported regressions 2.6.31 -> 2.6.32 Rafael J. Wysocki
2010-01-24 22:23 ` [Bug #14894] pohmelfs: NULL pointer dereference Rafael J. Wysocki
2010-02-01  0:38 2.6.33-rc6: Reported regressions 2.6.31 -> 2.6.32 Rafael J. Wysocki
2010-02-01  0:43 ` [Bug #14894] pohmelfs: NULL pointer dereference Rafael J. Wysocki
2010-02-08  0:13 2.6.33-rc7: Reported regressions 2.6.31 -> 2.6.32 Rafael J. Wysocki
2010-02-08  0:28 ` [Bug #14894] pohmelfs: NULL pointer dereference Rafael J. Wysocki
2010-02-14 23:46 2.6.33-rc8: Reported regressions 2.6.31 -> 2.6.32 Rafael J. Wysocki
2010-02-14 23:52 ` [Bug #14894] pohmelfs: NULL pointer dereference Rafael J. Wysocki

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=20100106200037.GA17641@ioremap.net \
    --to=zbr@ioremap.net \
    --cc=a.beregalov@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=kernel-testers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /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).