lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221125070959.49027-1-zhangjiachen.jaycee@bytedance.com>
Date:   Fri, 25 Nov 2022 15:09:59 +0800
From:   Jiachen Zhang <zhangjiachen.jaycee@...edance.com>
To:     "Matthew Wilcox (Oracle)" <willy@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, xieyongji@...edance.com,
        Jiachen Zhang <zhangjiachen.jaycee@...edance.com>
Subject: [PATCH] filemap: Fix some misleading comments

The users of filemap_write_and_wait_range() and file_write_and_wait_range()
interfaces should set the lend parameter to LLONG_MAX, rather than -1, to
indicate they want to writeback to the very end-of-file, as several kernel
code paths are checking the 'wbc->range_end == LLONG_MAX' conditions.

Signed-off-by: Jiachen Zhang <zhangjiachen.jaycee@...edance.com>
---
 mm/filemap.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 65eee6ec1066..c6d066a39425 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -661,7 +661,8 @@ EXPORT_SYMBOL_GPL(filemap_range_has_writeback);
  * Write out and wait upon file offsets lstart->lend, inclusive.
  *
  * Note that @lend is inclusive (describes the last byte to be written) so
- * that this function can be used to write to the very end-of-file (end = -1).
+ * that this function can be used to write to the very end-of-file (@lend =
+ * LLONG_MAX).
  *
  * Return: error status of the address space.
  */
@@ -758,7 +759,8 @@ EXPORT_SYMBOL(file_check_and_advance_wb_err);
  * Write out and wait upon file offsets lstart->lend, inclusive.
  *
  * Note that @lend is inclusive (describes the last byte to be written) so
- * that this function can be used to write to the very end-of-file (end = -1).
+ * that this function can be used to write to the very end-of-file (@lend =
+ * LLONG_MAX).
  *
  * After writing out and waiting on the data, we check and advance the
  * f_wb_err cursor to the latest value, and return any errors detected there.
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ