summaryrefslogtreecommitdiff
path: root/mount/lomount.c
AgeCommit message (Collapse)AuthorFilesLines
2007-11-26mount: fix fd leakMatthias Koenig1-0/+1
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2007-10-26mount: prevent loop mounting the same file twiceKarel Zak1-1/+107
The mount syscall prevents mounting the same device twice to the same mountpoint. When loop mounting a file, for each file a new loop device gets allocated, which prevents the detection of loop mounting the same file to the same mountpoint twice. The patch adds a check to prevent double mounts, if the same loopfile is going to be mounted with the same offset to the same mountpoint. Co-Author: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-26losetup: canonicalize loopfile nameKarel Zak1-2/+12
When setting up a loop device, canonicalize the loop file name. This simplifies a later identification of loop file names when querying the loop devices. Co-Author: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-25losetup: fix errno usageKarel Zak1-8/+11
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-25mount: clean up global variablesKarel Zak1-5/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-25losetup: remove duplicate xstrdup() and error()Karel Zak1-31/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-11losetup: clean up gcc warningsRandy Dunlap1-5/+5
Fix strict gcc warnings that come from using: ("-Wall -Wp,-D_FORTIFY_SOURCE=2") lomount.c:98: warning: pointer targets in initialization differ in signedness lomount.c:111: warning: format '%04x' expects type 'unsigned int', but argument 4 has type '__kernel_old_dev_t' lomount.c:300: warning: pointer targets in passing argument 1 of 'xstrncpy' differ in signedness lomount.c:307: warning: pointer targets in passing argument 1 of '__builtin___snprintf_chk' differ in signedness lomount.c:339: warning: pointer targets in passing argument 1 of 'xstrncpy' differ in signedness Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
2007-08-27mount: free loop device on failureSascha Sommer1-0/+1
Testcase: $ mount -oloop /etc/group /mnt ioctl: LOOP_CLR_FD: Device or resource busy mount: you must specify the filesystem type $ losetup /dev/loop0 /dev/loop0: [0803]:1931929 (/etc/group) Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2007-07-10lomount.c: don't use mlockall if CRYPT_NONEMasatake YAMATO1-6/+7
loop back mounting emits two system calls: mount and mlockall. mount is obviously needed. mlockall is needed for encryption. As the result both CAP_SYS_ADMIN and CAP_IPC_LOCK are needed to do loopback mounting. The problem is that CAP_IPC_LOCK is always needed through my command doesn't need encryption. With the following patch, mount calls mlockall only when encryption is needed. Signed-off-by: Masatake YAMATO <jet@gyve.org>
2007-06-27losetup: add long options and fix man pageKarel Zak1-9/+31
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-06-27mount: loop device race conditionMatthias Koenig1-5/+18
Fix race in losetup Retry acquiring a loop device if set_loop failed with EBUSY Signed-Off-By: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-06-27mount: loop device race conditionMatthias Koenig1-2/+10
Fix race in mount -o loop Retry acquiring a loop device if the setup failed with EBUSY. Signed-Off-By: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-06-18losetup: add a new option -sKarel Zak1-3/+10
The losetup provides an -f option to discover an unused loop device. As implemented, it is racy. The problem is that -f prints the loop device to stdout only when used standalone. This means a script has to do: lodev=$(losetup -f) losetup $lodev $filename which is racy if another script may be running. This patch add a new option '-s'. The '-s' option prints device name if the -f option and a file argument are present. For example: lodev=$(losetup -f -s $filename) Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-22losetup: add support read-only loopsKarel Zak1-2/+6
This feature has been already supported by mount, but it wasn't accessible by losetup command. Now you can use "losetup -r". Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-22losetup: add -a option to list all used loop devicesKarel Zak1-14/+58
Signed-off-by: Karel Zak <kzak@redhat.com>
2006-12-07Imported from util-linux-2.12o tarball.Karel Zak1-5/+4
2006-12-07Imported from util-linux-2.12k tarball.Karel Zak1-3/+7
2006-12-07Imported from util-linux-2.12j tarball.Karel Zak1-51/+75
2006-12-07Imported from util-linux-2.12h tarball.Karel Zak1-15/+19
2006-12-07Imported from util-linux-2.12b tarball.Karel Zak1-6/+7
2006-12-07Imported from util-linux-2.12a tarball.Karel Zak1-151/+216
2006-12-07Imported from util-linux-2.12pre tarball.Karel Zak1-216/+151
2006-12-07Imported from util-linux-2.12 tarball.Karel Zak1-151/+216
2006-12-07Imported from util-linux-2.11x tarball.Karel Zak1-2/+3
2006-12-07Imported from util-linux-2.11o tarball.Karel Zak1-1/+1
2006-12-07Imported from util-linux-2.11b tarball.Karel Zak1-6/+5
2006-12-07Imported from util-linux-2.10s tarball.Karel Zak1-9/+42
2006-12-07Imported from util-linux-2.10m tarball.Karel Zak1-214/+339
2006-12-07Imported from util-linux-2.9v tarball.Karel Zak1-24/+34
2006-12-07Imported from util-linux-2.8 tarball.Karel Zak1-8/+7
2006-12-07Imported from util-linux-2.7.1 tarball.Karel Zak1-87/+145
2006-12-07Imported from util-linux-2.2 tarball.Karel Zak1-0/+223