From: Dave Chinner <david@fromorbit.com>
To: Jeff Liu <jeff.liu@oracle.com>
Cc: "Michael L. Semon" <mlsemon35@gmail.com>,
"xfs@oss.sgi.com" <xfs@oss.sgi.com>
Subject: Re: [PATCH v2] xfs: fix assertion failure in xfs_vm_write_failed()
Date: Tue, 19 Mar 2013 10:30:26 +1100 [thread overview]
Message-ID: <20130318233026.GS6369@dastard> (raw)
In-Reply-To: <51469C90.1000001@oracle.com>
On Mon, Mar 18, 2013 at 12:48:16PM +0800, Jeff Liu wrote:
> Hello,
>
> Here is the v2 patch for fixing ASSERTION failed at xfs_vm_write_failed() according
> to Dave's comments, so I added Dave as SOB for credit.
No, please don't add my SOB to a patch you wrote, even if I came up
with the idea of how to do something. A SOB indicates that someone
has verified the origin of the patch (e.g. for copyright reasons),
not who contributed to finding the problem. IOWs, adding someone
else's SOB to a patch you wrote is almost always the wrong thing to
do.
The correct way to acknowledge someone's contribution to the
fix if they didn't write the patch is by a line in the commit
message saying something like "Thanks to .... for helping find and
fix the problem." [Edit: I just noticed you did this bit. ;) ]
If .... agrees with your fix, then they can add a reviewed-by line
to the patch, which has significantly different meaning to a SOB...
....
> Reported-by: Michael L. Semon <mlsemon35@gmail.com>
> Signed-off-by: Jie Liu <jeff.liu@oracle.com>
> Signed-off-by: Dave Chinner <david@fromorbit.com>
> ---
> fs/xfs/xfs_aops.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index 5f707e5..a418e17 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -1494,7 +1494,8 @@ xfs_vm_write_failed(
> loff_t pos,
> unsigned len)
> {
> - loff_t block_offset = pos & PAGE_MASK;
> + loff_t block_offset = (pos >> PAGE_CACHE_SHIFT) <<
> + PAGE_CACHE_SHIFT;
> loff_t block_start;
> loff_t block_end;
> loff_t from = pos & (PAGE_CACHE_SIZE - 1);
This needs a comment explaining why we aren't just masking the value
off with PAGE_MASK. And given that it wraps, something like:
- loff_t block_offset = pos & PAGE_MASK;
+ loff_t block_offset;
.....
+ /*
+ * comment about 32 bit systems, 64 bit variables and masks
+ */
+ block_offset = (pos >> PAGE_CACHE_SHIFT) << PAGE_CACHE_SHIFT;
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-03-18 23:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-18 4:48 [PATCH v2] xfs: fix assertion failure in xfs_vm_write_failed() Jeff Liu
2013-03-18 20:03 ` Michael L. Semon
2013-03-18 23:30 ` Dave Chinner [this message]
2013-03-19 6:08 ` Jeff Liu
2013-03-19 19:23 ` Dave Chinner
2013-03-20 2:18 ` Jeff Liu
2013-04-08 21:47 ` Mark Tinguely
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=20130318233026.GS6369@dastard \
--to=david@fromorbit.com \
--cc=jeff.liu@oracle.com \
--cc=mlsemon35@gmail.com \
--cc=xfs@oss.sgi.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