public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Zhen Zhao <zp_8483@163.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH v1] xfs: return err code if xfs_buf_associate_memory fail
Date: Tue, 23 Mar 2021 09:13:45 -0700	[thread overview]
Message-ID: <20210323161345.GL22100@magnolia> (raw)
In-Reply-To: <20210323062456.67938-1-zp_8483@163.com>

On Tue, Mar 23, 2021 at 02:24:56AM -0400, Zhen Zhao wrote:
> In kernel 3.10, when there is no memory left in the
> system, fs_buf_associate_memory can fail, catch the
> error and return.

You're probably going to need to take this up with your kernel
distributor or the linux stable fixes list, since (AFAICT) none of this
exists in the upstream kernel.

--D

> Signed-off-by: Zhen Zhao <zp_8483@163.com>
> ---
>  fs/xfs/xfs_log.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index 2e5581bc..32a41bf5 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -1916,8 +1916,11 @@ xlog_sync(
>  	if (split) {
>  		bp = iclog->ic_log->l_xbuf;
>  		XFS_BUF_SET_ADDR(bp, 0);	     /* logical 0 */
> -		xfs_buf_associate_memory(bp,
> +		error = xfs_buf_associate_memory(bp,
>  				(char *)&iclog->ic_header + count, split);
> +		if (error)
> +			return error;
> +
>  		bp->b_fspriv = iclog;
>  		bp->b_flags &= ~XBF_FLUSH;
>  		bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE | XBF_FUA);
> -- 
> 2.27.0
> 
> 

      reply	other threads:[~2021-03-23 16:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23  6:24 [PATCH v1] xfs: return err code if xfs_buf_associate_memory fail Zhen Zhao
2021-03-23 16:13 ` Darrick J. Wong [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=20210323161345.GL22100@magnolia \
    --to=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zp_8483@163.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