linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francis Moreau <francis.moro@gmail.com>
To: Andreas Dilger <adilger@sun.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: sys_umount() returns EBUSY when doing: sh -c "mount /dev/sdc1 /mnt; umount /mnt"
Date: Mon, 15 Mar 2010 21:19:05 +0100	[thread overview]
Message-ID: <38b2ab8a1003151319h42d023dek4c9912ca5039c80d@mail.gmail.com> (raw)
In-Reply-To: <AEFA39B9-7F8A-4F55-8268-991F1DF098BB@sun.com>

On Mon, Mar 15, 2010 at 5:04 PM, Andreas Dilger <adilger@sun.com> wrote:
> On 2010-03-13, at 13:30, Francis Moreau wrote:
>>
>> I've some shell scripts which try to find out the filesystem hosted by
>> a block device.
>>
>> They basically do this:
>>
>>  mount /dev/sdc1 /mnt
>>  fs=$(stat -f -c %T $mount_point)
>>  umount /mnt
>
> Mounting an in-use filesystem is a bad idea.

But it's not: /dev/sdc1 is not mounted anywhere before executing the script.

Someone else pointed out that some other processes (such as hal, gnome
stuff...) may have detected the new mount point and started to access
it hence preventing umount(8) to work.

-- 
Francis
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2010-03-15 20:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <38b2ab8a1003130056u4b025839i556a797ccad894de@mail.gmail.com>
2010-03-13 20:30 ` sys_umount() returns EBUSY when doing: sh -c "mount /dev/sdc1 /mnt; umount /mnt" Francis Moreau
2010-03-15 16:04   ` Andreas Dilger
2010-03-15 16:34     ` Al Viro
2010-03-15 20:23       ` Francis Moreau
2010-03-16  6:53       ` Ian Kent
2010-03-15 20:19     ` Francis Moreau [this message]

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=38b2ab8a1003151319h42d023dek4c9912ca5039c80d@mail.gmail.com \
    --to=francis.moro@gmail.com \
    --cc=adilger@sun.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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).