fsadm bug

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

 



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]")
_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux