All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <mason@suse.com>
To: Dave Johnson <djohnson+linux-kernel@sw.starentnetworks.com>,
	agruen@suse.de
Cc: Olaf Hering <olh@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: cramfs mounts provide corrupted content since 2.6.15
Date: Tue, 28 Feb 2006 14:14:55 -0500	[thread overview]
Message-ID: <200602281414.57084.mason@suse.com> (raw)
In-Reply-To: <17411.10591.927433.619327@zeus.sw.starentnetworks.com>

On Monday 27 February 2006 11:31, Dave Johnson wrote:

> I think I've spotted an issue.
>
> Both ifind() and find_inode() will call the test function on inodes
> that still have I_LOCK|I_NEW set.  This means everything that the
> test function needs _must_ be set in the set function (which is called
> while the inode_lock is still held).
>
> This could cause issues for inodes of 1 (only i_ino is getting set
> right now).

The problem is that two files are getting the same inode number because 
their offsets are the same.

ls -lai:
3412140 -rw-r--r--  1 root root       0 Jan  1  1970 ./etc/mtab
3412140 -rw-r--r--  1 root root    1220 Jan  1  1970 ./etc/nsswitch.conf

So, if /etc/mtab is read first, /etc/nsswitch.conf ends up with size zero, 
because it uses the mtab inode.

Andreas Gruenbacher suggested this change.  Along with your patch, things 
are working here again:

-chris

diff -r 0f4fc87886c2 fs/cramfs/inode.c
--- a/fs/cramfs/inode.c	Fri Feb 24 16:18:23 2006 -0500
+++ b/fs/cramfs/inode.c	Tue Feb 28 14:00:11 2006 -0500
@@ -36,7 +36,7 @@ static DECLARE_MUTEX(read_mutex);
 
 /* These two macros may change in future, to provide better st_ino
    semantics. */
-#define CRAMINO(x)	((x)->offset?(x)->offset<<2:1)
+#define CRAMINO(x)	(((x)->offset && (x)->size)?(x)->offset<<2:1)
 #define OFFSET(x)	((x)->i_ino)
 
 

  reply	other threads:[~2006-02-28 19:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-25 11:08 cramfs mounts provide corrupted content since 2.6.15 Olaf Hering
2006-02-25 12:55 ` Olaf Hering
2006-02-25 16:38   ` Dave Johnson
2006-02-25 22:01     ` Olaf Hering
2006-02-27 16:31       ` Dave Johnson
2006-02-28 19:14         ` Chris Mason [this message]
2006-02-28 20:40           ` Dave Johnson
2006-02-28 20:53             ` Chris Mason
2006-02-28 21:08               ` Dave Johnson
2006-02-28 21:13                 ` Chris Mason
     [not found]           ` <20060301155813.245d71ff.akpm@osdl.org>
     [not found]             ` <20060301235858.GA6792@suse.de>
     [not found]               ` <17414.16541.260439.712849@zeus.sw.starentnetworks.com>
     [not found]                 ` <20060302115446.GA9708@suse.de>
     [not found]                   ` <20060302093216.67b90533.akpm@osdl.org>
2006-03-02 17:45                     ` [PATCH] " Dave Johnson

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=200602281414.57084.mason@suse.com \
    --to=mason@suse.com \
    --cc=agruen@suse.de \
    --cc=djohnson+linux-kernel@sw.starentnetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olh@suse.de \
    /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.