From: Eric Sandeen <sandeen@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] libxfs: don't return cnt as failure from XFS_BUF_SET_PTR
Date: Thu, 22 Feb 2018 16:41:17 -0600 [thread overview]
Message-ID: <9dee9e11-3480-8406-1d8e-8fc14220371b@redhat.com> (raw)
In-Reply-To: <20180222214647.GH9827@magnolia>
On 2/22/18 3:46 PM, Darrick J. Wong wrote:
> On Thu, Feb 22, 2018 at 03:33:04PM -0600, Eric Sandeen wrote:
>> We must not get here very often, because any test of an error
>> from XFS_BUF_SET_PTR will fail because it returns whatever
>> is sent in as cnt. Fix the macro to return 0 so that
>> "error = XFS_BUF_SET_PTR()" works as expected.
>>
>> Should probably make this xfs_buf_associate_memory() to be
>> more like kernelspace, but for now just fix up the bug.
>>
>> Found this via xfs_logprint failing for no good reason.
>>
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>>
>> diff --git a/libxfs/libxfs_io.h b/libxfs/libxfs_io.h
>> index 81d2804..0ae7a28 100644
>> --- a/libxfs/libxfs_io.h
>> +++ b/libxfs/libxfs_io.h
>> @@ -105,6 +105,7 @@ enum xfs_buf_flags_t { /* b_flags bits */
>> #define XFS_BUF_SET_PTR(bp,p,cnt) ({ \
>> (bp)->b_addr = (char *)(p); \
>> XFS_BUF_SET_COUNT(bp,cnt); \
>> + 0; \
>
> There are only two callers of this macro and it's not exported to
> xfslibs headers, so why not just fix them not to care about the return
> value?
because it marginally matches kernel code ... *shrug* I'd rather
have libxlog diverge less from kernel, not more, overall.
-Eric
next prev parent reply other threads:[~2018-02-22 22:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 21:33 [PATCH] libxfs: don't return cnt as failure from XFS_BUF_SET_PTR Eric Sandeen
2018-02-22 21:46 ` Darrick J. Wong
2018-02-22 22:41 ` Eric Sandeen [this message]
2018-02-22 23:02 ` Darrick J. Wong
2018-02-22 23:10 ` Eric Sandeen
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=9dee9e11-3480-8406-1d8e-8fc14220371b@redhat.com \
--to=sandeen@redhat.com \
--cc=darrick.wong@oracle.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).