Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lZWN0-00032E-Gj for mharc-grub-devel@gnu.org; Thu, 22 Apr 2021 06:15:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZWMv-00030q-PE for grub-devel@gnu.org; Thu, 22 Apr 2021 06:15:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZWMq-000353-IK for grub-devel@gnu.org; Thu, 22 Apr 2021 06:15:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619086526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iwfbon5N2fBHFcpfucotVXHLBkSeNFAeip3O/VtjCSE=; b=V/udRUbjzzztV2np8aArzbcX2muZbXGCnMVv5/hiOVlUIuqWmr8eVSU41FAo9Gm/aXWKDT WtWgS5fGfoEY44gwZPWQSK9Yk6nO5NOcDnwgYzWrFLJk5Qi5dtKvC4MNXL05Gx3gtKHgx4 VJQYHfZyN8ey19/7E2i2ruqyw7RRz0k= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-442-DpjQn6cJPTmO4QeXEeq90Q-1; Thu, 22 Apr 2021 06:15:21 -0400 X-MC-Unique: DpjQn6cJPTmO4QeXEeq90Q-1 Received: by mail-wm1-f70.google.com with SMTP id j187-20020a1c23c40000b0290127873d3384so1136090wmj.6 for ; Thu, 22 Apr 2021 03:15:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=iwfbon5N2fBHFcpfucotVXHLBkSeNFAeip3O/VtjCSE=; b=Iq0mXLyE0NiSRj7fHXkBfYxB0uTJ/yn59x3PoY5JgAxUzjbww19ejQ1gOMVIzzWu5f Hc3EoMbmZkZZf0RpbUe0S+/VNFzPKmNhKXd71jJdr1+/NfFKdt8CeIgez07rSV6cJ81b YEnPodf4xSYrxPBXFfzopPw9DIRzEwXoaroO1kt03/Baf9xHagwbUJQBzZ8W4yOKZos7 pWcku3tRJHmuO8Oescme0aq3r0oftaSzl+sPYZNOiOrcF01qKShXysI0K1aWDWXKaVjQ z57Ikaggh3c5BkXuo4Q/hvzHWXOX9Roagn8ksF4+0YCWayCHjpLxJP8+hy97XNkZEEc+ IAJg== X-Gm-Message-State: AOAM530jjpWGaIX3A8mvHKaCIjCd5LOVmNJdLnI+noJ55YtfVWEhpxoZ cDgW2sK8u6rw+OCkzZiG4oR6bXdQN+tW3e+aMxLN4vh31meBRJA3mnjDjI5HIX6qnVWyIamASUn yr34zLT7X5oA= X-Received: by 2002:a5d:564a:: with SMTP id j10mr3227406wrw.108.1619086520242; Thu, 22 Apr 2021 03:15:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCz/h3igqKe7XwjgFUleUo1pSbq6OiGL7n9MieGt5k2YcDQryDc3zjK4OfJgskgrS4FhaUhA== X-Received: by 2002:a5d:564a:: with SMTP id j10mr3227383wrw.108.1619086519993; Thu, 22 Apr 2021 03:15:19 -0700 (PDT) Received: from [192.168.1.101] ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id v4sm2621092wme.14.2021.04.22.03.15.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Apr 2021 03:15:19 -0700 (PDT) Subject: Re: [PATCH] xfs: Print a warning if the filesystem needs to be repaired To: Carlos Maiolino , The development of GNU GRUB Cc: Eric Sandeen References: <20210419151650.207380-1-javierm@redhat.com> <20210420134900.ff6p2urawxlaqimm@tomti.i.net-space.pl> <20210422092049.36xgqj36iejw75q2@omega.lan> From: Javier Martinez Canillas Message-ID: <18625b00-6520-714d-2825-aa4297cb529c@redhat.com> Date: Thu, 22 Apr 2021 12:15:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210422092049.36xgqj36iejw75q2@omega.lan> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=170.10.133.124; envelope-from=javierm@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 10:15:36 -0000 On 4/22/21 11:20 AM, Carlos Maiolino wrote: > Hi Daniel > >>> --- a/grub-core/fs/xfs.c >>> +++ b/grub-core/fs/xfs.c >>> @@ -79,6 +79,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); >>> #define XFS_SB_FEAT_INCOMPAT_FTYPE (1 << 0) /* filetype in dirent */ >>> #define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */ >>> #define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */ >>> +#define XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR (1 << 4) /* needs xfs_repair */ >> >> s/XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR/XFS_SB_FEAT_INCOMPAT_NEEDS_REPAIR/ > > I believe Javier got this from kernel, I wonder if it doesn't make sense to keep > the flags names consistent with kernel? That's correct, I copied the macro name from the kernel and agree with Carlos that's better to keep it the same. It makes much easier to grep the kernel source code when looking for something: #define XFS_SB_FEAT_INCOMPAT_FTYPE (1 << 0) /* filetype in dirent */ #define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */ #define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */ #define XFS_SB_FEAT_INCOMPAT_BIGTIME (1 << 3) /* large timestamps */ #define XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR (1 << 4) /* needs xfs_repair */ https://elixir.bootlin.com/linux/latest/source/fs/xfs/libxfs/xfs_format.h#L471 > > >> >>> + grub_cpu_to_be16_compile_time(XFS_SB_VERSION_5) && >> >> Hmmm... Is XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR flag available for >> XFS_SB_VERSION_5 only? Should not we use ">=" instead of "=="? >> Does not older XFS versions support this flag? > > No, only xfs V5 superblock supports needsrepair flag. > Indeed, and there's no plan for a XFS v5+ in the near future as was explained to me by Carlos. I also copied the logic to check from the Linux kernel which uses '==' for all the flags supported only in v5. Best regards, -- Javier Martinez Canillas Software Engineer - Desktop Hardware Enablement Red Hat