[nacked] mm-filemapc-fix-the-timing-of-asignment-of-prev_pos.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The quilt patch titled
     Subject: mm/filemap.c: fix the timing of asignment of prev_pos
has been removed from the -mm tree.  Its filename was
     mm-filemapc-fix-the-timing-of-asignment-of-prev_pos.patch

This patch was dropped because it was nacked

------------------------------------------------------
From: Guixin Liu <kanie@xxxxxxxxxxxxxxxxx>
Subject: mm/filemap.c: fix the timing of asignment of prev_pos
Date: Wed, 17 Aug 2022 21:51:57 +0800

When I`m running repetitive 4k read io which has same offset, I find that
access to folio_mark_accessed is inevitable in the read process, the
reason is that the prev_pos is assigned after the iocb->ki_pos is
incremented, so that the prev_pos is always not equal to the position
currently visited.

The prev_pos should be assigned before the iocb->ki_pos is incremented, so
that the prev_pos is the exact location of the last visit.

Link: https://lkml.kernel.org/r/1660744317-8183-1-git-send-email-kanie@xxxxxxxxxxxxxxxxx
Fixes: 06c0444290cec ("mm/filemap.c: generic_file_buffered_read() now uses find_get_pages_contig")
Signed-off-by: Guixin Liu <kanie@xxxxxxxxxxxxxxxxx>
Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
Cc: Kent Overstreet <kent.overstreet@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/filemap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/filemap.c~mm-filemapc-fix-the-timing-of-asignment-of-prev_pos
+++ a/mm/filemap.c
@@ -2711,8 +2711,8 @@ ssize_t filemap_read(struct kiocb *iocb,
 			copied = copy_folio_to_iter(folio, offset, bytes, iter);
 
 			already_read += copied;
-			iocb->ki_pos += copied;
 			ra->prev_pos = iocb->ki_pos;
+			iocb->ki_pos += copied;
 
 			if (copied < bytes) {
 				error = -EFAULT;
_

Patches currently in -mm which might be from kanie@xxxxxxxxxxxxxxxxx are





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux