From: Brian Foster <bfoster@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 5/7] xfs: make imaxpct changes in growfs separate
Date: Fri, 9 Feb 2018 11:11:43 -0500 [thread overview]
Message-ID: <20180209161143.GB21413@bfoster.bfoster> (raw)
In-Reply-To: <20180201064202.7174-6-david@fromorbit.com>
On Thu, Feb 01, 2018 at 05:42:00PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> When growfs changes the imaxpct value of the filesystem, it runs
> through all the "change size" growfs code, whether it needs to or
> not. Separate out changing imaxpct into it's own function and
> transaction to simplify the rest of the growfs code.
>
> Signed-Off-By: Dave Chinner <dchinner@redhat.com>
> ---
> fs/xfs/xfs_fsops.c | 67 +++++++++++++++++++++++++++++++++++++++---------------
> 1 file changed, 49 insertions(+), 18 deletions(-)
>
> diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
> index 94650b7d517e..5c844e540320 100644
> --- a/fs/xfs/xfs_fsops.c
> +++ b/fs/xfs/xfs_fsops.c
...
> @@ -673,25 +661,68 @@ xfs_growfs_log_private(
...
> int
> xfs_growfs_data(
> - xfs_mount_t *mp,
> - xfs_growfs_data_t *in)
> + struct xfs_mount *mp,
> + struct xfs_growfs_data *in)
> {
> - int error;
> + int error = 0;
>
> if (!capable(CAP_SYS_ADMIN))
> return -EPERM;
> if (!mutex_trylock(&mp->m_growlock))
> return -EWOULDBLOCK;
> +
> + /* update imaxpct seperately to the physical grow of the filesystem */
separately
> + if (in->imaxpct != mp->m_sb.sb_imax_pct) {
> + error = xfs_growfs_imaxpct(mp, in->imaxpct);
> + if (error)
> + goto out_error;
> + }
> +
> error = xfs_growfs_data_private(mp, in);
> + if (error)
> + goto out_error;
The 'xfs_growfs -m <maxpct>' use case typically doesn't involve a size
change. With this change, there's no reason to run through
xfs_growfs_data_private() if in.newblocks == mp->m_sb.sb_dblocks, right?
Otherwise this seems fine.
Brian
> +
> + /*
> + * Post growfs calculations needed to reflect new state in operations
> + */
> + if (mp->m_sb.sb_imax_pct) {
> + uint64_t icount = mp->m_sb.sb_dblocks * mp->m_sb.sb_imax_pct;
> + do_div(icount, 100);
> + mp->m_maxicount = icount << mp->m_sb.sb_inopblog;
> + } else
> + mp->m_maxicount = 0;
> +
> +out_error:
> /*
> * Increment the generation unconditionally, the error could be from
> * updating the secondary superblocks, in which case the new size
> --
> 2.15.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-02-09 16:11 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-01 6:41 [PATCH 0/7] xfs: refactor and tablise growfs Dave Chinner
2018-02-01 6:41 ` [PATCH 1/7] xfs: factor out AG header initialisation from growfs core Dave Chinner
2018-02-08 18:53 ` Brian Foster
2018-02-01 6:41 ` [PATCH 2/7] xfs: convert growfs AG header init to use buffer lists Dave Chinner
2018-02-08 18:53 ` Brian Foster
2018-02-01 6:41 ` [PATCH 3/7] xfs: factor ag btree reoot block initialisation Dave Chinner
2018-02-08 18:54 ` Brian Foster
2018-02-08 20:00 ` Darrick J. Wong
2018-02-09 13:10 ` Brian Foster
2018-02-12 0:45 ` Darrick J. Wong
2018-02-15 5:53 ` Darrick J. Wong
2018-02-01 6:41 ` [PATCH 4/7] xfs: turn ag header initialisation into a table driven operation Dave Chinner
2018-02-09 16:11 ` Brian Foster
2018-02-01 6:42 ` [PATCH 5/7] xfs: make imaxpct changes in growfs separate Dave Chinner
2018-02-09 16:11 ` Brian Foster [this message]
2018-02-15 22:10 ` Dave Chinner
2018-02-01 6:42 ` [PATCH 6/7] xfs: separate secondary sb update in growfs Dave Chinner
2018-02-09 16:11 ` Brian Foster
2018-02-15 22:23 ` Dave Chinner
2018-02-16 12:31 ` Brian Foster
2018-02-01 6:42 ` [PATCH 7/7] xfs: rework secondary superblock updates " Dave Chinner
2018-02-09 16:12 ` Brian Foster
2018-02-15 22:31 ` Dave Chinner
2018-02-16 12:56 ` Brian Foster
2018-02-16 16:20 ` Darrick J. Wong
2018-02-19 2:16 ` Dave Chinner
2018-02-19 13:21 ` Brian Foster
2018-02-19 22:14 ` Dave Chinner
2018-02-20 12:44 ` Brian Foster
2018-03-24 0:37 ` Darrick J. Wong
2018-02-06 23:44 ` [PATCH 0/7] xfs: refactor and tablise growfs Darrick J. Wong
2018-02-07 7:10 ` Dave Chinner
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=20180209161143.GB21413@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=david@fromorbit.com \
--cc=linux-xfs@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 NNTP newsgroup(s).