All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Kirby <sim@netnation.com>
To: linux-kernel@vger.kernel.org, Alexander Viro <viro@math.psu.edu>
Subject: Something broken in sys_swapon
Date: Sat, 3 Nov 2001 12:23:44 -0800	[thread overview]
Message-ID: <20011103122344.A12059@netnation.com> (raw)

Looking through sys_swapon() for the culprit of my corruption after a
nonexistent swap device is added (/dev/hdb2 when /dev/hda is my only hard
drive and hdc and hdd are cdroms), I notice a things that look a bit odd.

First, set_blocksize(dev, PAGE_SIZE) is done twice in the S_ISBLK block
(it should only be needed once?), but furthermore:

                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
definitely explain the corruption I see if my file system block size is
changed (/ is a 2KB block-sized EXT2 filesystem).

Simon-

[  Stormix Technologies Inc.  ][  NetNation Communications Inc. ]
[       sim@stormix.com       ][       sim@netnation.com        ]
[ Opinions expressed are not necessarily those of my employers. ]

             reply	other threads:[~2001-11-03 20:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-03 20:23 Simon Kirby [this message]
2001-11-03 20:31 ` Something broken in sys_swapon Alexander Viro
2001-11-03 21:13   ` Simon Kirby
2001-11-04 11:46     ` Mike Black
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=20011103122344.A12059@netnation.com \
    --to=sim@netnation.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.