From: Steve Dickson <SteveD@RedHat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] mount.nfs: Only ignore EBUSY when a filesystem is already mount
Date: Mon, 22 Oct 2018 10:57:59 -0400 [thread overview]
Message-ID: <adc626f5-cc47-d4fc-6062-042ff0aec905@RedHat.com> (raw)
In-Reply-To: <20181020145347.134233-1-steved@redhat.com>
On 10/20/18 10:53 AM, Steve Dickson wrote:
> EBUSY errors can be caused by using the -o sharecache
> flag and different context= values. So make sure
> the filesytem is mounted before ignoring the EBUSY error.
>
> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1629705
>
> Found-by: Jianhong.Yin <yin-jianhong@163.com>
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed...
steved.
> ---
> utils/mount/Makefile.am | 1 +
> utils/mount/stropts.c | 16 ++++++++++------
> 2 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/utils/mount/Makefile.am b/utils/mount/Makefile.am
> index 7b97c31..ad0be93 100644
> --- a/utils/mount/Makefile.am
> +++ b/utils/mount/Makefile.am
> @@ -27,6 +27,7 @@ endif
>
> mount_nfs_LDADD = ../../support/nfs/libnfs.la \
> ../../support/export/libexport.a \
> + ../../support/misc/libmisc.a \
> $(LIBTIRPC)
>
> mount_nfs_SOURCES = $(mount_common)
> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> index 4d2e37e..eed0356 100644
> --- a/utils/mount/stropts.c
> +++ b/utils/mount/stropts.c
> @@ -48,6 +48,7 @@
> #include "version.h"
> #include "parse_dev.h"
> #include "conffile.h"
> +#include "misc.h"
>
> #ifndef NFS_PROGRAM
> #define NFS_PROGRAM (100003)
> @@ -1078,12 +1079,15 @@ static int nfsmount_fg(struct nfsmount_info *mi)
> if (nfs_try_mount(mi))
> return EX_SUCCESS;
>
> - if (errno == EBUSY)
> - /* The only cause of EBUSY is if exactly the desired
> - * filesystem is already mounted. That can arguably
> - * be seen as success. "mount -a" tries to optimise
> - * out this case but sometimes fails. Help it out
> - * by pretending everything is rosy
> +#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
> + if (errno == EBUSY && is_mountpoint(mi->node))
> +#pragma GCC diagnostic warning "-Wdiscarded-qualifiers"
> + /*
> + * EBUSY can happen when mounting a filesystem that
> + * is already mounted or when the context= are
> + * different when using the -o sharecache
> + *
> + * Only error out in the latter case.
> */
> return EX_SUCCESS;
>
>
prev parent reply other threads:[~2018-10-22 14:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-20 14:53 [PATCH] mount.nfs: Only ignore EBUSY when a filesystem is already mount Steve Dickson
2018-10-22 14:57 ` Steve Dickson [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=adc626f5-cc47-d4fc-6062-042ff0aec905@RedHat.com \
--to=steved@redhat.com \
--cc=linux-nfs@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