linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chandan Babu R <chandanrlinux@gmail.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org, sandeen@redhat.com
Subject: Re: [PATCH 2/2] xfs: make xfs_growfs_rt update secondary superblocks
Date: Thu, 08 Oct 2020 13:01:59 +0530	[thread overview]
Message-ID: <4070961.BB4q84YiFQ@garuda> (raw)
In-Reply-To: <160212937238.248573.3832120826354421788.stgit@magnolia>

On Thursday 8 October 2020 9:26:12 AM IST Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> When we call growfs on the data device, we update the secondary
> superblocks to reflect the updated filesystem geometry.  We need to do
> this for growfs on the realtime volume too, because a future xfs_repair
> run could try to fix the filesystem using a backup superblock.
> 
> This was observed by the online superblock scrubbers while running
> xfs/233.  One can also trigger this by growing an rt volume, cycling the
> mount, and creating new rt files.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  fs/xfs/xfs_rtalloc.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
> index 1c3969807fb9..5b2e68d9face 100644
> --- a/fs/xfs/xfs_rtalloc.c
> +++ b/fs/xfs/xfs_rtalloc.c
> @@ -18,7 +18,7 @@
>  #include "xfs_trans_space.h"
>  #include "xfs_icache.h"
>  #include "xfs_rtalloc.h"
> -
> +#include "xfs_sb.h"
>  
>  /*
>   * Read and return the summary information for a given extent size,
> @@ -1108,6 +1108,11 @@ xfs_growfs_rt(
>  	 */
>  	kmem_free(nmp);
>  
> +	/* Update secondary superblocks now the physical grow has completed */
> +	error = xfs_update_secondary_sbs(mp);
> +	if (error)
> +		return error;
> +

If any of the operations in the previous "for" loop causes "error" to be set
and the loop to be exited, the call to xfs_update_secondary_sbs() would
overwrite this error value. In the worst case it might set error to 0 and
hence return a success status to the caller when the growfs operation
had actually failed.

-- 
chandan




  reply	other threads:[~2020-10-08  7:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08  3:56 [PATCH 0/2] xfs: a couple of realtime growfs fixes Darrick J. Wong
2020-10-08  3:56 ` [PATCH 1/2] xfs: fix realtime bitmap/summary file truncation when growing rt volume Darrick J. Wong
2020-10-08  6:56   ` Chandan Babu R
2020-10-08  3:56 ` [PATCH 2/2] xfs: make xfs_growfs_rt update secondary superblocks Darrick J. Wong
2020-10-08  7:31   ` Chandan Babu R [this message]
2020-10-08 14:47     ` Darrick J. Wong
2020-10-08  3:59 ` [RFC PATCH 3/2] xfstest: test running growfs on the realtime volume Darrick J. Wong
2020-10-08  8:12   ` Chandan Babu R
2020-10-08 15:02     ` Darrick J. Wong

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=4070961.BB4q84YiFQ@garuda \
    --to=chandanrlinux@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.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 NNTP newsgroup(s).