From: Shiyang Ruan <ruansy.fnst@fujitsu.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-xfs@vger.kernel.org>,
<nvdimm@lists.linux.dev>, <linux-mm@kvack.org>,
<linux-fsdevel@vger.kernel.org>, <djwong@kernel.org>,
<dan.j.williams@intel.com>, <david@fromorbit.com>,
<hch@infradead.org>, <jane.chu@oracle.com>
Subject: Re: [PATCH v9 1/3] xfs: fix the calculation of length and end
Date: Mon, 6 Feb 2023 14:45:53 +0800 [thread overview]
Message-ID: <0b8551a2-1d46-8ac8-5073-5b094507975a@fujitsu.com> (raw)
In-Reply-To: <Y9+WHXyA2GufLWpw@casper.infradead.org>
在 2023/2/5 19:42, Matthew Wilcox 写道:
> On Sat, Feb 04, 2023 at 02:58:36PM +0000, Shiyang Ruan wrote:
>> @@ -222,8 +222,8 @@ xfs_dax_notify_failure(
>> len -= ddev_start - offset;
>> offset = 0;
>> }
>> - if (offset + len > ddev_end)
>> - len -= ddev_end - offset;
>> + if (offset + len - 1 > ddev_end)
>> + len -= offset + len - 1 - ddev_end;
>
> This _looks_ wrong. Are you sure it shouldn't be:
>
> len = ddev_end - offset + 1;
>
It is to make sure the range won't beyond the end of device.
But actually, both of us are rgiht.
Mine: len -= offset + len - 1 - ddev_end;
=> len = len - (offset + len - 1 - ddev_end);
=> len = len - offset - len + 1 + ddev_end;
=> len = ddev_end - offset + 1; --> Yours
I forgot to simplify it. Will fix.
--
Thanks,
Ruan.
next prev parent reply other threads:[~2023-02-06 6:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-04 14:58 [RESEND PATCH v9 0/3] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind Shiyang Ruan
2023-02-04 14:58 ` [PATCH v9 1/3] xfs: fix the calculation of length and end Shiyang Ruan
2023-02-05 11:42 ` Matthew Wilcox
2023-02-06 6:45 ` Shiyang Ruan [this message]
2023-02-04 14:58 ` [PATCH v9 2/3] fs: move drop_pagecache_sb() for others to use Shiyang Ruan
2023-02-05 11:51 ` Matthew Wilcox
2023-02-04 14:58 ` [PATCH v9 3/3] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind Shiyang Ruan
2023-02-05 21:10 ` Matthew Wilcox
2023-02-05 21:50 ` 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=0b8551a2-1d46-8ac8-5073-5b094507975a@fujitsu.com \
--to=ruansy.fnst@fujitsu.com \
--cc=dan.j.williams@intel.com \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=jane.chu@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=willy@infradead.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