linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] fsadm bug
@ 2012-02-18 14:58 Oliver Mangold
  0 siblings, 0 replies; only message in thread
From: Oliver Mangold @ 2012-02-18 14:58 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

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

[-- Attachment #2: fsadm_fix.diff --]
[-- Type: text/x-patch, Size: 563 bytes --]

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]")

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-18 14:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-18 14:58 [linux-lvm] fsadm bug Oliver Mangold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).