All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Kent <raven@themaw.net>
To: Sergei Zhirikov <sfzhi@yahoo.com>
Cc: autofs@linux.kernel.org
Subject: Re: Strange behavior of autofs with reiserfs on expire
Date: Wed, 15 Apr 2009 16:15:25 +0800	[thread overview]
Message-ID: <20090415081524.GA7194@zeus.themaw.net> (raw)
In-Reply-To: <gs2khi$f5$1@ger.gmane.org>

On Tue, Apr 14, 2009 at 08:26:57PM +0200, Sergei Zhirikov wrote:
> 
> Can anyone, please, try to reproduce the problem?

Yep, did that.

How stupid of me to assume all file systems would set the super block
magic number to a non-zero value. Or maybe it isn't me who has done
something stupid this time, ;)

The patch below seems to fix this.
The CHANGELOG hunk won't apply of course but the other hunks should
be OK.

Ian

autofs-5.0.4 - zero s_magic is valid

From: Ian Kent <raven@themaw.net>

When checking the super magic using the mount control ioctl
re-implementation an incorrect assumption is made that s_magic
field in the super block will not be zero.
---

 CHANGELOG           |    1 +
 lib/dev-ioctl-lib.c |   10 ++++------
 2 files changed, 5 insertions(+), 6 deletions(-)


diff --git a/CHANGELOG b/CHANGELOG
index 50bfca8..8254eb5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -38,6 +38,7 @@
 - fix memory leak reading master map.
 - fix st_remove_tasks() locking.
 - reset flex scanner when setting buffer.
+- zero s_magic is valid.
 
 4/11/2008 autofs-5.0.4
 -----------------------
diff --git a/lib/dev-ioctl-lib.c b/lib/dev-ioctl-lib.c
index 7c8c433..a034a3d 100644
--- a/lib/dev-ioctl-lib.c
+++ b/lib/dev-ioctl-lib.c
@@ -764,12 +764,10 @@ static int dev_ioctl_ismountpoint(unsigned int logopt,
 	if (err) {
 		*mountpoint = DEV_IOCTL_IS_MOUNTED;
 
-		if (param->ismountpoint.out.magic) {
-			if (param->ismountpoint.out.magic == AUTOFS_SUPER_MAGIC)
-				*mountpoint |= DEV_IOCTL_IS_AUTOFS;
-			else
-				*mountpoint |= DEV_IOCTL_IS_OTHER;
-		}
+		if (param->ismountpoint.out.magic == AUTOFS_SUPER_MAGIC)
+			*mountpoint |= DEV_IOCTL_IS_AUTOFS;
+		else
+			*mountpoint |= DEV_IOCTL_IS_OTHER;
 	}
 
 	free_dev_ioctl_path(param);

  reply	other threads:[~2009-04-15  8:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 18:26 Strange behavior of autofs with reiserfs on expire Sergei Zhirikov
2009-04-15  8:15 ` Ian Kent [this message]
2009-04-15 15:24   ` Sergei Zhirikov

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=20090415081524.GA7194@zeus.themaw.net \
    --to=raven@themaw.net \
    --cc=autofs@linux.kernel.org \
    --cc=sfzhi@yahoo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.