Util-Linux Archive mirror
 help / color / mirror / Atom feed
From: zhujun2 <zhujun2@cmss.chinamobile.com>
To: kzak@redhat.com
Cc: util-linux@vger.kernel.org, zhujun2@cmss.chinamobile.com
Subject: Re: [PATCH] blkid: solve a bug that the disk device of the ceph_bluestore
Date: Mon, 17 Jul 2023 19:48:46 -0700	[thread overview]
Message-ID: <20230718024846.8734-1-zhujun2@cmss.chinamobile.com> (raw)
In-Reply-To: <20230620095725.juhogmjqjue4ohjf@ws.net.home>

> On Tue, Jun 20, 2023 at 10:35:32AM +0800, karel wrote:
> Not sure if I understand. According to docs BlueStore uses XFS
> partition to store metadata and another device to store raw data. It
> sounds like the XFS should be visible as a normal filesystem.

> From your description it sounds like the both is on the same device
> and we should not detect it as XFS log. If yes, then I do not
> understand why anyone use XFS log header for this purpose.

> XFS log detection seems robust, so I guess if libblkid detects the
> superblock then it's really the FS.

You can specify another disk device to store the external log for the XFS file system, similar to the following command:
mkfs.xfs -l logdev=/dev/nvme0n1p2,size=10000b /dev/nvme0n1p3

Using the dd command, you can copy the first sector of /dev/nvme0n1p2 to any sector between 17 and 512 of the 
Ceph BlueStore file system for disk device A, for example, sector 51. After performing this action, a problem occurs where an additional file system, 
efs_external_log, is created on the disk device A originally used for Ceph BlueStore. 
This leads to udev errors and the loss of the disk device A's partlabel. for example

blkid -o udev -p /dev/xxxx
ID_FS_AMBIVALIENT=other:ceph_blueStore other:efs_external_log

Ceph BlueStore file system for Disk device A is exposed as a block device for users to use as a cloud disk. 
Users can create an XFS External Log on it.

zhujun2

>> Signed-off-by: zhujun2 <zhujun2@cmss.chinamobile.com>
>> ---
>>  libblkid/src/superblocks/xfs.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/libblkid/src/superblocks/xfs.c b/libblkid/src/superblocks/xfs.c
>> index d8c6fb6d4..3686bd52b 100644
>> --- a/libblkid/src/superblocks/xfs.c
>> +++ b/libblkid/src/superblocks/xfs.c
>> @@ -259,6 +259,11 @@ static int probe_xfs_log(blkid_probe pr,
>>  		if (memcmp(&buf[i*512], "XFSB", 4) == 0)
>>  			return 1;
>>  
>> +		if (memcmp(&buf[i*512], "bluestore block device", 22) == 0) {
>> +			DBG(LOWPROBE, ul_debug("\t device has ceph_bluestore ambivalent"));
>> +			return 1;
>> +		}
>> +
>>  		rhead = (struct xlog_rec_header *)&buf[i*512];
>>  
>>  		if (xlog_valid_rec_header(rhead)) {
>> -- 
>> 2.20.1



  parent reply	other threads:[~2023-07-18  2:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19  2:35 [PATCH] blkid: solve a bug that the disk device of the ceph_bluestore zhujun2
2023-06-20  9:57 ` Karel Zak
2023-07-11  3:12   ` zhujun2
2023-07-11  3:29   ` zhujun2
2023-07-18  2:48   ` zhujun2 [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-06-20  1:32 zhujun2

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=20230718024846.8734-1-zhujun2@cmss.chinamobile.com \
    --to=zhujun2@cmss.chinamobile.com \
    --cc=kzak@redhat.com \
    --cc=util-linux@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 read-only IMAP folder(s) and NNTP newsgroup(s).