Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Usama Arif <usama.arif@linux.dev>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Usama Arif <usama.arif@linux.dev>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v2 3/6] ntfs: Use zero_user_segment() in handle_bounds_compressed_page()
Date: Tue,  9 Jun 2026 06:07:11 -0700	[thread overview]
Message-ID: <20260609130713.2851385-1-usama.arif@linux.dev> (raw)
In-Reply-To: <20260608210618.3437216-4-willy@infradead.org>

On Mon,  8 Jun 2026 22:06:13 +0100 "Matthew Wilcox (Oracle)" <willy@infradead.org> wrote:

> This fixes handle_bounds_compressed_page() on highmem memory
> as page_address() does not work on memory which has been kmap_local(),
> only on kmap() memory.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>  fs/ntfs/compress.c | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c
> index b279f38636d6..89067fecf5a0 100644
> --- a/fs/ntfs/compress.c
> +++ b/fs/ntfs/compress.c
> @@ -108,16 +108,16 @@ static inline void handle_bounds_compressed_page(struct page *page,
>  	loff_t pos = page_offset(page);
>  
>  	if ((pos >= initialized_size) && (initialized_size < i_size)) {
> -		u8 *kp = page_address(page);
> -		unsigned int kp_ofs;
> +		size_t offset;
>  
>  		ntfs_debug("Zeroing page region outside initialized size.");
> -		if (pos >= initialized_size) {
> -			clear_page(kp);
> -			return;
> -		}
> -		kp_ofs = initialized_size & ~PAGE_MASK;
> -		memset(kp + kp_ofs, 0, PAGE_SIZE - kp_ofs);
> +		if (pos >= initialized_size)
> +			offset = 0;
> +		else
> +			offset = offset_in_page(initialized_size);

Is the else branch over here unreacheable as the outer if statement
already had if ((pos >= initialized_size) &&...


> +		zero_user_segment(page, offset, PAGE_SIZE);
> +	} else {
> +		flush_dcache_page(page);
>  	}
>  }
>  
> @@ -222,7 +222,6 @@ static int ntfs_decompress(struct page *dest_pages[], int completed_pages[],
>  				 */
>  				handle_bounds_compressed_page(dp, i_size,
>  						initialized_size);
> -				flush_dcache_page(dp);
>  				kunmap_local(page_address(dp));
>  				SetPageUptodate(dp);
>  				unlock_page(dp);
> @@ -758,7 +757,6 @@ int ntfs_read_compressed_block(struct folio *folio)
>  				 */
>  				handle_bounds_compressed_page(page, i_size,
>  						initialized_size);
> -				flush_dcache_page(page);
>  				kunmap_local(page_address(page));
>  				SetPageUptodate(page);
>  				unlock_page(page);
> -- 
> 2.47.3
> 
> 


  parent reply	other threads:[~2026-06-09 13:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 21:06 [PATCH v2 0/6] Remove __folio_index again Matthew Wilcox (Oracle)
2026-06-08 21:06 ` [PATCH v2 1/6] ntfs: Inline zero_partial_compressed_page() Matthew Wilcox (Oracle)
2026-06-09  0:18   ` Hyunchul Lee
2026-06-08 21:06 ` [PATCH v2 2/6] ntfs: Remove use of __folio_index in handle_bounds_compressed_page() Matthew Wilcox (Oracle)
2026-06-09  0:19   ` Hyunchul Lee
2026-06-09 13:17   ` Usama Arif
2026-06-09 14:34     ` Matthew Wilcox
2026-06-09 15:55       ` Usama Arif
2026-06-08 21:06 ` [PATCH v2 3/6] ntfs: Use zero_user_segment() " Matthew Wilcox (Oracle)
2026-06-09  0:20   ` Hyunchul Lee
2026-06-09 13:07   ` Usama Arif [this message]
2026-06-08 21:06 ` [PATCH v2 4/6] ntfs: Remove references to page->__folio_index Matthew Wilcox (Oracle)
2026-06-09  0:22   ` Hyunchul Lee
2026-06-08 21:06 ` [PATCH v2 5/6] show_page_info: Remove printing of page index Matthew Wilcox (Oracle)
2026-06-09 11:59   ` Ye Liu
2026-06-09 18:44   ` David Hildenbrand (Arm)
2026-06-08 21:06 ` [PATCH v2 6/6] mm: Remove __folio_index Matthew Wilcox (Oracle)
2026-06-09 18:43   ` David Hildenbrand (Arm)
2026-06-09  5:06 ` [PATCH v2 0/6] Remove __folio_index again Namjae Jeon

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=20260609130713.2851385-1-usama.arif@linux.dev \
    --to=usama.arif@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --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