From: Karel Zak <kzak@redhat.com>
To: Andi Drebes <lists-receive@programmierforen.de>
Cc: linux-btrfs@vger.kernel.org, Chris Mason <chris.mason@oracle.com>,
"Yan, Zheng" <yanzheng@21cn.com>
Subject: Re: [PATCH 1/2] btrfs-progs: multidevice support for check_mounted
Date: Sat, 21 Nov 2009 21:21:10 +0100 [thread overview]
Message-ID: <20091121202109.GD16301@nb.net.home> (raw)
In-Reply-To: <200911211538.38351.lists-receive@programmierforen.de>
On Sat, Nov 21, 2009 at 03:38:38PM +0100, Andi Drebes wrote:
> +
> +/* Checks if an mntentry represents a pseudo FS */
> +int is_pseudo_fs(const struct mntent* mnt)
> +{
> + struct stat st_buf;
> +
> + if(stat(mnt->mnt_fsname, &st_buf) < 0) {
> + if(errno == ENOENT)
> + return 1;
> + else
> + return -errno;
> + }
> +
> + return 0;
> +}
This is bad idea. The mnt_fsname field could be an arbitrary string
include valid paths.
# grep sysfs /proc/mounts
/sys /sys sysfs rw,relatime 0 0
Karel
--
Karel Zak <kzak@redhat.com>
next prev parent reply other threads:[~2009-11-21 20:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-21 14:33 [PATCH 0/2] btrfs-progs: mounted filesystems checks Andi Drebes
2009-11-21 14:38 ` [PATCH 1/2] btrfs-progs: multidevice support for check_mounted Andi Drebes
2009-11-21 20:21 ` Karel Zak [this message]
2009-11-22 13:33 ` Andi Drebes
2009-11-23 9:01 ` Karel Zak
2009-11-21 14:39 ` [PATCH 2/2] btrfs-progs: prevent btrfsck to run on mounted filesystems Andi Drebes
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=20091121202109.GD16301@nb.net.home \
--to=kzak@redhat.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=lists-receive@programmierforen.de \
--cc=yanzheng@21cn.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