Age | Commit message (Collapse) | Author | Files | Lines |
|
Old version
Filename Type Size Used Priority
/dev/sda3 partition 2353516 76 -1
/dev/dm-1 partition 409596 0 -2
New version:
Filename Type Size Used Priority
/dev/sda3 partition 2353516 76 -1
/dev/mapper/VUL-lvol0 partition 409596 0 -2
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Swapon checks whether a swap device is active by searching for the
device name in /proc/swaps. /proc/swaps always specifies the path
to real device file, even if the path to real device file, even
if symlink was passed to the swapon() system call.
This differs from /proc/mounts semantics where each string contains
exactly the same device name as it was passed to the mount*() system call.
If a swap partition resides on lvm, libblkid returns a name in
form /dev/mapper/*, but now there are symlinks pointing to device
files /dev/dm-*, resulting to /proc/swaps containing /dev/dm-*,
but swapon still looks for /dev/mapper/* and tries to activate
the swap partition again.
[kzak@redhat.com: - remove unnecessary changes from
is_in_proc_swaps()]
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
Tested-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
On systems without /etc/mtab (or everywhere if kernel >= 2.6.37)
we use loop autoclear flag and then the backing file name is not
stored in /etc/mtab. mount(8) uses sysfs to get the filename (or
LOOP_GET_STATU* ioctls on old kernels).
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
The basic loopdev attributes are available in sysfs since kernel
2.6.37. This patch uses the backing_file attribute from sysfs for very
long filenames (the LOOP_GET_STATUS ioctl uses only 64 bytes for the
filename).
old version:
# losetup -a
/dev/loop0: [0804]:12865322 (/home/images/filesystems/this_is_really_really_long_directory_*)
new version:
# losetup -a
/dev/loop0: [0804]:12865322 (/home/images/filesystems/this_is_really_really_long_directory_name/ext2.img)
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
The new swsuspend signature has been added by commit
3624eb04c24861ab296842414f9752a393e68372 to kernel 2.6.37-rc1.
Reported-by: "Dr. David Alan Gilbert" <linux@treblig.org>
Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/682176
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
This patch replaces a few functions used throughout the source:
* Renames getnum (from schedutils) to strtol_or_err
* Moves strtosize (from lib/strtosize.c)
* Moves xstrncpy (from include/xstrncpy.h)
* Adds strnlen, strnchr and strndup if not available (remove it from libmount utils)
A few Makefile.am files were modified to compile accordingly along with trivial renaming
in schedutils source code.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=563267
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=653705
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Suggested by Hugh Dickins. Thanks.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
In kernel 2.6.36 (and in stable kernel 2.6.35.5) I made a tiny change
to the swapon(const char *path, int swapflags) system call interface:
kernel commit 3399446632739fcd05fd8b272b476a69c6e6d14a
swap: discard while swapping only if SWAP_FLAG_DISCARD
As things stand at present, we could just remove the swap discard
support; but since several filesystems (including ext4 and btrfs and
fat) are offering a "discard" mount option, I thought swap should take
the same course, and offer a "--discard" or "-d" option to swapon(8).
[kzak@redhat.com: - update swapon.8 man page
- use for -d the same logic as for -p]
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Thanks to Kay Sievers.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
This option is already supported by mount(8) and fsck(8), there is no
reason to have any exception for swap devices. Note that the --ifexists
command line option applies to all swap devices, the "nofail" setting
is per device.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
umount(8) segfaults when update incomplete mtab file after remount to
read-only (-r). For example autofs does not store info about
mountpoint to /etc/mtab file.
# mount /dev/sda1 /mnt/test
# sed -i -e 's:/dev/sda1 .*::g' /etc/mtab
# cd /mnt/test
# umount -r /mnt/test
umount: /mnt/test busy - remounted read-only
Segmentation fault
The command "umount -r" should not care about /etc/mtab if the related
mtab entry does not exist.
Reported-by: Paul Crawford <psc@sat.dundee.ac.uk>
Addresses: https://bugs.launchpad.net/bugs/579858
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
The warning is from util-linux 2.7.1 (year 1996)... the filesystems
detection is pretty generic now.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
"Spec" was still canonicalized despite --no-canonicalize. This
resulted in a hang during login with pam_encfs (Debian Bug#593336).
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
|
|
Reported-by: Bernhard Voelker <bernhard.voelker@siemens-enterprise.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
When calling "mount -t 9p -o trans=virtio foobar /mnt/bar" and foobar
exists in the current path, the 9p virtio transport driver will be
called with $CWD/foobar and fail with "9p: no channels available".
Similar problems exist with remote file servers
"mount -t 9p 23.42.08.15 /mnt/bar"
and Plan 9 From User Space applications
"mount -t 9p -o trans=unix,uname=$USER `namespace`/acme /mnt/bar"
A similar exception like for nfs, cifs and smbfs must be added for 9p.
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Since Linux kernel commit 955234755ce4a2c33cfc558912aa8f2148cc1fc6,
the default mode for vfat filesystem is 'shortname=mixed'.
Reported-by: Harald Koenig <koenig@linux.de>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
|
|
This new implementation is more optimistic and always calls access(2).
The fallback solution (modify atime by futimens(2)) should be used
very rarely.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=632373
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Linux can handle filesystem types with "MAINTYPE.SUBTYPE" format,
where the main type determines the actual filesystem driver while the
subtype can be interpreted by the filesystem itself.
When searching for mount helpers mount(8) and umount(8) should also
interpret such types, falling back to (u)mount.MAINTYPE if
(u)mount.MAINTYPE.SUBTYPE doesn't exist.
This patch implements this, passing the type with "-t TYPE"
to the mount program in this case.
Reported-by: Josef Bacik <josef@redhat.com>
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=625064
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
|
|
mount(8) reuses mount flags from fstab/mtab, the problem is that for
MS_PROPAGATION operations kernel incorrectly evaluates mount flags if
the flags contains any non-propagation stuff (e.g. MS_RDONLY). For
example --make-shared on read-only FS:
# strace -e mount mount --make-shared /mnt/test
mount("/dev/sda1", "/mnt/test", "none", MS_RDONLY|MS_SHARED, NULL) = 0
must be:
# strace -e mount mount --make-shared /mnt/test
mount("/dev/sda1", "/mnt/test", "none", MS_SHARED, NULL) = 0
Reported-by: Valerie Aurora <vaurora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
|
|
realloc(NULL, size) behaves the same as malloc(size) so there is no need
to distinguish between the two.
[kzak@redhat.com: - better handle realloc() errors]
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Reported-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
I spent most of the day tracking down this subtle remount bug. I
think this is the correct solution but I'd appreciate some
double-checking. I suspect this bug will munge the mount options
whenever you remount a file system mounted on the same mountpoint as
another file system, using the mountpoint as the handle.
-VAL
commit c010b3a0783430e2b94f3b3dc0929ae299e383eb
Author: Valerie Aurora <vaurora@redhat.com>
Date: Tue Aug 3 16:32:52 2010 -0700
mount: get most recently mounted fs from /etc/mtab.
In mount, when using /etc/mtab to lookup a mount entry, get the most
recently mounted entry instead of the first mounted entry. You want
to manipulate the most recent mount, not a covered mount. See comment
to umount_one_bw().
This bug has been util-linux-ng since the first git checkin. It
finally showed up on my system with the change to stop using
SETLOOP_AUTOCLEAR if /etc/mtab is writable (commit af092544). If you
do a remount of a file system mounted on the same dir as another file
system, it will take the options from the first mount and write them
out to /etc/mtab as the options to the second mount - including, in
the case of a loop device, loop=/dev/loop0. Then when you umount the
second mount, it grabs the line from /etc/mtab and tries to tear down
the loop device, which complains because it is still in use by the
first mount.
Reproducible test case (on a system with writable /etc/mtab):
mount -o loop,ro /tmp/ro /mnt
mount -t tmpfs tmpfs /mnt
mount -o remount,ro /mnt
cat /etc/mtab | tail -2
Signed-off-by: Valerie Aurora <vaurora@redhat.com>
|
|
The "mount -a" uses /etc/mtab to detect already mounted file systems
from /etc/fstab -- this check requires the same FS name (1st field)
in fstab and mtab.
On systems with enabled auto-clear loop devies or systems without
regular mtab (symlink to /proc/mounts) there is /dev/loopN rather
than image filename in mtab. For example:
fstab:
/mnt/store/foo.ISO /mnt/image auto defaults 0 0
mtab:
/dev/loop0 /mnt/image iso9960 rw 0 0
We have to scan all available loop devices to check if some of the
devices is not associated with the image file from fstab.
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=618957
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
# mount /home/images/floppy.img /mnt/test2
# mount | grep loop
/dev/loop0 on /mnt/test2 type udf (rw)
mount(8) with auto-clear loopdev does not store information about the
original backing file (the image) to /etc/mtab. (Note that this is our
long-term goal, because we want to remove mtab from Linux.)
Unfortunately, losetup(8) is not able to provide full path for the
backing file, because LOOP_GET_STATUS ioctl uses 64 bytes for the
filename...
So, without the information about the backing file in mtab the
information about mapping between the file and the loopdev is
unaccessible from userspace.
From my point of view it would be nice to add all necessary
information about loopdevs to /sys rather than rely on broken
LOOP_GET_STATUS[64] ioctls.
with this patch:
# mount /home/images/floppy.img /mnt/test2
# mount | grep loop# mount | grep loop
/home/images/floppy.img on /mnt/test2 type udf (ro,loop=/dev/loop0)
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=615389
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Btrfs, as of 2.6.35, is unable to allow swapfiles to be used on its
filesystems. This is due to the swapfile implementation wanting to
build an extent map of each block in the file and expecting it to be
static for the life of the swapfile.
Btrfs can't guarantee this and refuses to return the mapping. The
swapfile implementation just makes a comment about there being holes
in the file - but that's how btrfs denies the mapping.
This patch adds a section to the swapon manpage to document it.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
|
|
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
|
|
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
|
|
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=602573
Reported-by: Adam Tkac <atkac@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Linux kernel can silently add MS_RDONLY flag when mounting file system that
does not have write support. Check this to avoid 'ro' in /proc/mounts and 'rw'
in mtab.
[kzak@redhat.com: - don't check for 'ro' for MS_MOVE and MS_PROPAGATION]
Reported-by: James Foris <jim.foris@med.ge.com>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
On Fri, May 21, 2010 at 08:00:09AM -0400, Christoph Hellwig wrote:
> On Fri, May 21, 2010 at 01:55:17PM +0200, Petr Uzel wrote:
> > SUSE-based distributions have the following patch for some time. More
> > info here: https://bugzilla.novell.com/show_bug.cgi?id=447036
> >
> > From the Novell bugzilla:
> > <quote>
> > > I cannot see any justification for that sync call at all so I'd
> > > probably just remove it. Your
> > > patch is possibly safer so maybe it should be used as is.
> > </quote>
> >
> > So, does anybody know why/if the sync() is actually needed?
>
> It's not needed. The kernel performs a sync by itself.
Thanks, Christoph.
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
|
|
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
|