linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
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	[thread overview]
Message-ID: <4F3FBCA6.3050909@googlemail.com> (raw)

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

                 reply	other threads:[~2012-02-18 14:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F3FBCA6.3050909@googlemail.com \
    --to=o.mangold@googlemail.com \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).