public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Ian Kent <raven@themaw.net>
Cc: Jiri Slaby <xslaby@fi.muni.cz>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: BUG: atomic counter underflow [Was: 2.6.16-rc6-mm1]
Date: Sun, 19 Mar 2006 02:18:23 +0059	[thread overview]
Message-ID: <441CB176.8020103@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0603131330210.21830@eagle.themaw.net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ian Kent napsal(a):
> On Sun, 12 Mar 2006, Jiri Slaby wrote:
> 
>> Andrew Morton wrote:
>>> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.16-rc6/2.6.16-rc6-mm1/
>> [snip]
>>> +remove-redundant-check-from-autofs4_put_super.patch
>>> +autofs4-follow_link-missing-funtionality.patch
>>>
>>> Update autofs4 patches in -mm.
>> Hello, 
>>
>> I caught this during ftp browsing autofs-bind-mounted directories. I don't know
>> circumstancies and if the patches above are source of problem. I also don't know
>> if -rc6-mm1 is the first one.
> 
> btw what do you mean autofs-bind-mounted ?
> 
>> BUG: atomic counter underflow at:
>>  [<c0104736>] show_trace+0x13/0x15
>>  [<c0104873>] dump_stack+0x1e/0x20
>>  [<c01d6c97>] autofs4_wait+0x751/0x93a
>>  [<c01d543b>] try_to_fill_dentry+0xca/0x11c
>>  [<c01d59b3>] autofs4_revalidate+0xe1/0x148
>>  [<c0171338>] do_lookup+0x40/0x157
>>  [<c0172ec4>] __link_path_walk+0x804/0xe8c
>>  [<c017359c>] link_path_walk+0x50/0xe8
>>  [<c01738b7>] do_path_lookup+0x10f/0x26d
>>  [<c017429c>] __user_walk_fd+0x33/0x50
>>  [<c016d226>] vfs_stat_fd+0x1e/0x50
>>  [<c016d30d>] vfs_stat+0x20/0x22
>>  [<c016d328>] sys_stat64+0x19/0x2d
>>  [<c0103127>] syscall_call+0x7/0xb
>>
> 
> There's some suspicious code in waitq.c.
> Could you try the following patch for me please?
Yes, the patch below does solve the problem, can go upstream, good work!
> 
> --- linux-2.6.16-rc6-mm1/fs/autofs4/waitq.c.notify-bug	2006-03-13 13:23:52.000000000 +0800
> +++ linux-2.6.16-rc6-mm1/fs/autofs4/waitq.c	2006-03-13 13:25:40.000000000 +0800
> @@ -263,7 +263,7 @@ int autofs4_wait(struct autofs_sb_info *
>  		wq->tgid = current->tgid;
>  		wq->status = -EINTR; /* Status return if interrupted */
>  		atomic_set(&wq->wait_ctr, 2);
> -		atomic_set(&wq->notified, 1);
> +		atomic_set(&wq->notify, 1);
>  		mutex_unlock(&sbi->wq_mutex);
>  	} else {
>  		atomic_inc(&wq->wait_ctr);
> @@ -273,9 +273,11 @@ int autofs4_wait(struct autofs_sb_info *
>  			(unsigned long) wq->wait_queue_token, wq->len, wq->name, notify);
>  	}
>  
> -	if (notify != NFY_NONE && atomic_dec_and_test(&wq->notified)) {
> +	if (notify != NFY_NONE && atomic_read(&wq->notify)) {
>  		int type;
>  
> +		atomic_dec(&wq->notify);
> +
>  		if (sbi->version < 5) {
>  			if (notify == NFY_MOUNT)
>  				type = autofs_ptype_missing;
> --- linux-2.6.16-rc6-mm1/fs/autofs4/autofs_i.h.notify-bug	2006-03-13 13:23:39.000000000 +0800
> +++ linux-2.6.16-rc6-mm1/fs/autofs4/autofs_i.h	2006-03-13 13:24:08.000000000 +0800
> @@ -85,7 +85,7 @@ struct autofs_wait_queue {
>  	pid_t tgid;
>  	/* This is for status reporting upon return */
>  	int status;
> -	atomic_t notified;
> +	atomic_t notify;
>  	atomic_t wait_ctr;
>  };
>  
> 
> 
> 

thanks,
- --
Jiri Slaby         www.fi.muni.cz/~xslaby
\_.-^-._   jirislaby@gmail.com   _.-^-._/
B67499670407CE62ACC8 22A032CC55C339D47A7E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFEHLF2MsxVwznUen4RAjKxAJwMjbCTrNJ88HMXSLdEr+HuTJ7QoACfb+bS
J4s6vVAbXiJ9KDijb1C8nLI=
=MDV2
-----END PGP SIGNATURE-----

  parent reply	other threads:[~2006-03-19  1:18 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-12 11:10 2.6.16-rc6-mm1 Andrew Morton
2006-03-12 13:16 ` 2.6.16-rc6-mm1 Rafael J. Wysocki
2006-03-12 13:35   ` 2.6.16-rc6-mm1 Sam Ravnborg
2006-03-12 13:49     ` 2.6.16-rc6-mm1 Rafael J. Wysocki
2006-03-12 14:29   ` [PATCH] kbuild: fix genksyms build error Sam Ravnborg
2006-03-12 15:46 ` 2.6.16-rc6-mm1 Benoit Boissinot
2006-03-12 15:48 ` 2.6.16-rc6-mm1 Benoit Boissinot
2006-03-12 15:55 ` 2.6.16-rc6-mm1 Benoit Boissinot
2006-03-12 18:45 ` 2.6.16-rc6-mm1: BUG at fs/sysfs/inode.c:180 Laurent Riffard
2006-03-12 22:55   ` Alexey Dobriyan
2006-03-12 23:33     ` Laurent Riffard
2006-03-12 23:01   ` Andrew Morton
2006-03-13 14:00     ` Maneesh Soni
2006-03-13 17:04       ` Laurent Riffard
2006-03-13 19:22         ` Greg KH
2006-03-14  3:23           ` Maneesh Soni
2006-03-12 21:43 ` BUG: atomic counter underflow [Was: 2.6.16-rc6-mm1] Jiri Slaby
2006-03-13  3:35   ` Ian Kent
2006-03-13  5:33   ` Ian Kent
2006-03-17 16:47     ` Jiri Slaby
2006-03-17 17:47     ` Jiri Slaby
2006-03-19  1:06       ` Jiri Slaby
2006-03-19  1:19     ` Jiri Slaby [this message]
2006-03-23 11:44       ` Ian Kent
2006-03-12 21:47 ` 2.6.16-rc6-mm1 Grant Coady
2006-03-13  3:18 ` 2.6.16-rc6-mm1 James Morris
2006-03-13  4:39 ` 2.6.16-rc6-mm1 (NFS tree ... busy inodes ... relatively harmless) Neil Brown
2006-03-13  4:47   ` Andrew Morton
2006-03-13 21:14 ` [-mm patch] sound/pci/ice1712/delta.c: make 2 functions static Adrian Bunk
2006-03-14 11:16   ` Takashi Iwai
2006-03-13 21:16 ` [RFC: -mm patch] remove drivers/message/fusion/mptscsih.c:mptscsih_setDevicePage1Flags() Adrian Bunk
2006-03-13 21:19 ` [RFC: -mm patch] fs/nfsd/export.c,net/sunrpc/cache.c: make needlessly global code static Adrian Bunk
2006-03-13 21:21 ` [RFC: -mm patch] remove drivers/scsi/constants.c:scsi_print_req_sense() Adrian Bunk
2006-03-13 21:26 ` [-mm patch] make drivers/net/tg3.c:tg3_request_irq() Adrian Bunk
2006-03-15  1:04   ` David S. Miller
2006-03-13 21:28 ` [-mm patch] dvb/frontends/zl10353.c: make a function static Adrian Bunk
2006-03-15  7:41 ` 2.6.16-rc6-mm1 Nishanth Aravamudan

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=441CB176.8020103@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raven@themaw.net \
    --cc=xslaby@fi.muni.cz \
    /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