From: Brian Foster <bfoster@redhat.com>
To: Hou Tao <houtao1@huawei.com>
Cc: linux-xfs@vger.kernel.org, sandeen@sandeen.net
Subject: Re: [PATCH v2] xfs_logprint: handle log operation split of inode item correctly
Date: Fri, 13 Jan 2017 10:49:41 -0500 [thread overview]
Message-ID: <20170113154941.GG22013@bfoster.bfoster> (raw)
In-Reply-To: <1484305530-19129-1-git-send-email-houtao1@huawei.com>
On Fri, Jan 13, 2017 at 07:05:30PM +0800, Hou Tao wrote:
> If the data/attr fork log operations of an inode log item are splitted to
> the next log record, xfs_logprint doesn't check the remaining log operations
> in current log record and still tries to print these log operations which
> don't exist in the log record. The content of these log operations will be
> incorrect, or worse xfs_logprint will trigger a segment-fault and exit.
>
> xfs_logprint also doesn't calculate the count of the splitted log operations
> correctly. It just returns 1 when the current log operation is splitted to
> the next log record. It needs to consider the log operations behind.
>
> Signed-off-by: Hou Tao <houtao1@huawei.com>
> ---
A couple minor things..
First, could you please update the commit log as noted in my last reply
to v1?
> logprint/log_misc.c | 28 +++++++++++++++++-----------
> 1 file changed, 17 insertions(+), 11 deletions(-)
>
> v2:
> - rewrite the commit message to clarify the patch
> - use "skip_count" suggested by Brian Foster
> - fix the indentation
>
> v1: http://www.spinics.net/lists/linux-xfs/msg03430.html
>
> diff --git a/logprint/log_misc.c b/logprint/log_misc.c
> index a0f1766..4fa0ce1 100644
> --- a/logprint/log_misc.c
> +++ b/logprint/log_misc.c
...
> @@ -644,7 +649,8 @@ xlog_print_trans_inode(
> }
> *ptr += be32_to_cpu(op_head->oh_len);
> if (op_head->oh_flags & XLOG_CONTINUE_TRANS)
> - return 1;
> + return skip_count;
> + skip_count--;
> }
>
> return 0;
Could we ASSERT(skip_count == 0) before we return here?
Otherwise this looks Ok to me.
Brian
> --
> 2.5.0
>
> --
> 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
prev parent reply other threads:[~2017-01-13 15:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 11:05 [PATCH v2] xfs_logprint: handle log operation split of inode item correctly Hou Tao
2017-01-13 15:49 ` Brian Foster [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=20170113154941.GG22013@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=houtao1@huawei.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.