[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[linux-lvm] fsadm bug
- From: Oliver Mangold <o mangold googlemail com>
- To: linux-lvm redhat com
- Subject: [linux-lvm] fsadm bug
- Date: Sat, 18 Feb 2012 15:58:46 +0100
Hi,
I would like to report a bug in the fsadm script.
Trying to resize a filesystem which has a device name that is equal to
the beginning of another mounted device (which of course can happen with
the devices in /dev/mapper created for lvm) fails for me. The script
complains that the filesystem is mounted (even if it is not), then tries
to unmount *the other* filesystem (which can fail, of course). E.g. you
want to resize a filesystem with the name /dev/mapper/foobar but there
another filesystem mounted somewhere from the device /dev/mapper/foo the
problem appears.
Reason is that the device path is simply grepped from /proc/mounts
without checking that the matched string is the whole device path. I
attached a quick fix which solved the problem for me, but imho it does
not fix all potential issues here. The device path is used unmodified as
a regexp and also it is not checked if the match is in the correct
column of the line.
Best,
Oliver
203c203
< MOUNTED=$("$GREP" ^"$VOLUME" "$PROCMOUNTS")
---
> MOUNTED=$("$GREP" ^"$VOLUME[ \t]" "$PROCMOUNTS")
206c206
< test -z "$MOUNTED" && MOUNTED=$("$GREP" ^"$RVOLUME" "$PROCMOUNTS")
---
> test -z "$MOUNTED" && MOUNTED=$("$GREP" ^"$RVOLUME[ \t]" "$PROCMOUNTS")
210a211
>
215,216c216,217
< MOUNTED=$(LANG=C "$MOUNT" | "$GREP" ^"$VOLUME")
< test -z "$MOUNTED" && MOUNTED=$(LANG=C "$MOUNT" | "$GREP" ^"$RVOLUME")
---
> MOUNTED=$(LANG=C "$MOUNT" | "$GREP" ^"$VOLUME[ \t]")
> test -z "$MOUNTED" && MOUNTED=$(LANG=C "$MOUNT" | "$GREP" ^"$RVOLUME[ \t]")
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]