linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: dick.streefland@xs4all.nl (Dick Streefland)
Cc: linux-kernel@vger.kernel.org,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	Maneesh Soni <maneesh@in.ibm.com>
Subject: Re: [PATCH] autofs4 doesn't expire
Date: Tue, 5 Aug 2003 16:49:04 -0700	[thread overview]
Message-ID: <20030805164904.36b5d2cc.akpm@osdl.org> (raw)
In-Reply-To: <4b0c.3f302ca5.93873@altium.nl>

spam@streefland.xs4all.nl (Dick Streefland) wrote:
>
> In linux-2.6.0-test1, lookup_mnt() was changed to increment the ref
> count of the returned vfsmount struct. This breaks expiration of
> autofs4 mounts, because lookup_mnt() is called in check_vfsmnt()
> without decrementing the ref count afterwards. The following patch
> fixes this:
> 

Neat, thanks.

Probably we should hold onto that ref because we play with the vfsmount
later on.  So something like this?


diff -puN fs/autofs4/expire.c~autofs4-expiry-fix fs/autofs4/expire.c
--- 25/fs/autofs4/expire.c~autofs4-expiry-fix	2003-08-05 16:44:41.000000000 -0700
+++ 25-akpm/fs/autofs4/expire.c	2003-08-05 16:48:20.000000000 -0700
@@ -25,7 +25,7 @@ static inline int is_vfsmnt_tree_busy(st
 	struct list_head *next;
 	int count;
 
-	count = atomic_read(&mnt->mnt_count) - 1;
+	count = atomic_read(&mnt->mnt_count) - 1 - 1;
 
 repeat:
 	next = this_parent->mnt_mounts.next;
@@ -70,8 +70,11 @@ static int check_vfsmnt(struct vfsmount 
 	int ret = dentry->d_mounted;
 	struct vfsmount *vfs = lookup_mnt(mnt, dentry);
 
-	if (vfs && is_vfsmnt_tree_busy(vfs))
-		ret--;
+	if (vfs) {
+		if (is_vfsmnt_tree_busy(vfs))
+			ret = 0;
+		mntput(vfs);
+	}
 	DPRINTK(("check_vfsmnt: ret=%d\n", ret));
 	return ret;
 }

_


  reply	other threads:[~2003-08-05 23:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-05 22:16 [PATCH] autofs4 doesn't expire Dick Streefland
2003-08-05 23:49 ` Andrew Morton [this message]
2003-08-06  0:03   ` Jeremy Fitzhardinge
2003-08-06  4:28   ` Maneesh Soni
2003-08-06  4:34     ` Jeremy Fitzhardinge
2003-08-06  5:00       ` Maneesh Soni
2003-08-06  5:01         ` Jeremy Fitzhardinge
2003-08-06  5:08         ` Andrew Morton
2003-08-06  5:38           ` Maneesh Soni

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=20030805164904.36b5d2cc.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=dick.streefland@xs4all.nl \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ibm.com \
    /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).