public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@clusterfs.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Is e2fsprogs-lustre_ismounted.patch actually needed?
Date: Wed, 11 Oct 2006 15:26:44 -0600	[thread overview]
Message-ID: <20061011212644.GU22010@schatzie.adilger.int> (raw)
In-Reply-To: <E1GWefa-0000r5-L8@candygram.thunk.org>

On Oct 08, 2006  15:50 -0400, Theodore Ts'o wrote:
> So I started reworking it so it would be acceptable, and
> then I realized it defined two new static functions, neither of which
> were actually used in the patch.

Correct, my initial testing was on 2.6, which as you say works OK, but
we still have some customers (sadly) running 2.4 kernels where O_EXCL
doesn't work.

> 	If for some reason there is a good reason why Lustre isn't
> marking the device as busy, then we can look at the attached patch, but
> hopefully it isn't required at all.
> 
> +static errcode_t check_if_lustre_busy(const char *devname, int *mount_flags)
> +{
> +	procname = "/proc/fs/lustre/obdfilter";
> +	dirp = opendir(procname);
> +	if (!dirp) {
> +		procname = "/proc/fs/lustre/mds";
> +		dirp = opendir(procname);
> +	}

This isn't quite correct, compared to the earlier patch that calls
check_lustre_proc_vals() twice.  Lustre uses filesystems as either a
metadata target or storage target, and more than one of each can exist
on the same node (though usually they don't for large systems).  That
means this function needs to always check both the .../obdfilter tree
and the .../mds tree on a given node.  The above code will skip the
.../mds tree if the .../obdfilter tree exists.

> +		if (strcmp(real_devname, real_mnt_device) == 0) {
> +#ifdef DEBUG
> +			fprintf(stderr,
> +				"device %s mounted by lustre per %s\n",
> +				real_devname, proc_val);
> +#endif

The reason this was printed is that Lustre mounts (done internally
by the kernel) do not show up in /proc/mounts, or this whole exercise
wouldn't be needed.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.


      reply	other threads:[~2006-10-11 21:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-08 19:50 Is e2fsprogs-lustre_ismounted.patch actually needed? Theodore Ts'o
2006-10-11 21:26 ` Andreas Dilger [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=20061011212644.GU22010@schatzie.adilger.int \
    --to=adilger@clusterfs.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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