Re: [PATCH] mount: prevent loop mounting the same file twice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 11, 2007 at 02:35:34PM +0200, Matthias Koenig wrote:
> 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.

 Applied, but with some changes.

 I have also added a warning (to verbose mount/losetup mode) when the
 same loop file is already associated with another loop device:

# losetup -v -f /mnt/store/images/fs/ext3.img
Loop device is /dev/loop0

# losetup -v -f /mnt/store/images/fs/ext3.img
warning: /mnt/store/images/fs/ext3.img is already associated with /dev/loop0
Loop device is /dev/loop1

 This is independent on mtab or mountpoints.

 Thanks!

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux