The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Mike Black" <mblack@csihq.com>
To: "Simon Kirby" <sim@netnation.com>, "Alexander Viro" <viro@math.psu.edu>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: Something broken in sys_swapon
Date: Sun, 4 Nov 2001 06:46:03 -0500	[thread overview]
Message-ID: <00a901c16526$48c64300$1a502341@cfl.rr.com> (raw)
In-Reply-To: <20011103122344.A12059@netnation.com> <Pine.GSO.4.21.0111031529490.18001-100000@weyl.math.psu.edu> <20011103131342.A15365@netnation.com>

I think I see a potential problem (I'm looking at 2.4.10) in fs/namei.c.

If path_init() returns 0 in __user_walk() then err is not set to anything
(it defaults to 0)

int __user_walk(const char *name, unsigned flags, struct nameidata *nd)
{
        char *tmp;
        int err;

        tmp = getname(name);
        err = PTR_ERR(tmp);
        if (!IS_ERR(tmp)) {
                err = 0;
                if (path_init(tmp, flags, nd))
                        err = path_walk(tmp, nd);
                putname(tmp);
        }
        return err;
}

----- Original Message -----
From: "Simon Kirby" <sim@netnation.com>
To: "Alexander Viro" <viro@math.psu.edu>
Cc: <linux-kernel@vger.kernel.org>
Sent: Saturday, November 03, 2001 4:13 PM
Subject: Re: Something broken in sys_swapon


> On Sat, Nov 03, 2001 at 03:31:25PM -0500, Alexander Viro wrote:
>
> > On Sat, 3 Nov 2001, Simon Kirby wrote:
> >
> > >                 kdev_t dev = swap_inode->i_rdev;
> > >                 struct block_device_operations *bdops;
> > >
> > >                 p->swap_device = dev;
> > >                 set_blocksize(dev, PAGE_SIZE);
> > >
> > > I don't know much at all about the inode structure, but doesn't this
set
> > > the block size of the originating filesystem containing the inode
rather
> > > than the block device that inode happens to be pointing to?  That
would
> >
> > man 2 stat
> >
> > i_rdev is equivalent of st_rdev, i_dev - of st_dev.
>
> Okay, would you see any other reason why my root filesystem would
> completely blow up after swapon /dev/hdb2 when /dev/hdb no longer exists?
>
> All I did was remove /dev/hdb and forget to take the swap entry out of
> /etc/fstab.  On boot I got "attempt to access beyond end of device"
> messages looping endlessly.  I tried once with / mounted rw (it looks
> like Debian still has / mounted ro when it turns on swap), and lots of
> filesystem corruption resulted.
>
> Simon-
>
> [  Stormix Technologies Inc.  ][  NetNation Communications Inc. ]
> [       sim@stormix.com       ][       sim@netnation.com        ]
> [ Opinions expressed are not necessarily those of my employers. ]
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


  reply	other threads:[~2001-11-04 11:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-03 20:23 Something broken in sys_swapon Simon Kirby
2001-11-03 20:31 ` Alexander Viro
2001-11-03 21:13   ` Simon Kirby
2001-11-04 11:46     ` Mike Black [this message]
2001-11-04 12:05       ` Alexander Viro
2001-11-04 20:22         ` Simon Kirby
2001-11-04 20:33           ` Simon Kirby

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='00a901c16526$48c64300$1a502341@cfl.rr.com' \
    --to=mblack@csihq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sim@netnation.com \
    --cc=viro@math.psu.edu \
    /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