Linux-BTRFS Archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org, Jiri Belka <jiri.belka@suse.com>
Subject: Re: [PATCH] btrfs-progs: mkfs: skip failed mount check
Date: Fri, 17 May 2024 18:24:08 +0200	[thread overview]
Message-ID: <20240517162407.GD17126@twin.jikos.cz> (raw)
In-Reply-To: <18c376d5ab4aa2c2088a0e204d14bb5331fe052f.1714985184.git.wqu@suse.com>

On Mon, May 06, 2024 at 06:16:27PM +0930, Qu Wenruo wrote:
> [BUG]
> There is a bug report that, with very weird mount status, there can be
> some mount source which can not be accessed:
> 
>   /hana/shared/QD2/global/hdb/security/ssfs secfs2 500G 57G 444G 12% /hana/shared/QD2/global/hdb/security/ssfs
> 
> Strace shows we can not access the above mount source:
> 
>  131065 stat("/hana/shared/QD2/global/hdb/security/ssfs", 0x7ffed17b8e20) = -1 EACCES (Permission denied)
> 
> And lead to failed mount check:
> 
>  131065 write(2, "ERROR: ", 7)      = 7
>  131065 write(2, "cannot check mount status of /de"..., 56) = 56
>  131065 write(2, "\n", 1)        = 1
> 
> [CAUSE]
> The mounted check is based on libblid, which gives the mount source, and
> for non-btrfs mounts, we call path_is_reg_or_block_device() to check if
> we even need to continue checking.
> 
> But in above case, the mount source is secfs2, and we can not access the
> source.
> 
> So we error out causing the check_mounted() to return error.
> 
> [FIX]
> There is never any guarantee we can access the mount source, but on the
> other hand, I do not want to ignore all access failure for the mount
> source.
> 
> So this patch would let test_status_for_mkfs() to only skip
> check_mounted() error if @force_overwrite is true.
> 
> This would still keep the old strict checks on whether the target is
> already mounted, but if the end user really knows that certain mount
> source do not need to be checked, they can always pass "-f" option to
> skip the false alerts.
> 
> Link: https://bugzilla.suse.com/show_bug.cgi?id=1223799
> Reported-by: Jiri Belka <jiri.belka@suse.com>
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Added to devel, thanks.

      reply	other threads:[~2024-05-17 16:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06  8:46 [PATCH] btrfs-progs: mkfs: skip failed mount check Qu Wenruo
2024-05-17 16:24 ` David Sterba [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=20240517162407.GD17126@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=jiri.belka@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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 read-only IMAP folder(s) and NNTP newsgroup(s).