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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8091114.T7Z3S40VBb@opensuse>
Date:   Thu, 14 Jul 2022 09:46:00 +0200
From:   "Fabio M. De Francesco" <fmdefrancesco@...il.com>
To:     Wang Yugui <wangyugui@...-tech.com>
Cc:     Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
        David Sterba <dsterba@...e.com>,
        Nick Terrell <terrelln@...com>, linux-btrfs@...r.kernel.org,
        linux-kernel@...r.kernel.org, Filipe Manana <fdmanana@...nel.org>,
        Ira Weiny <ira.weiny@...el.com>
Subject: Re: [PATCH] btrfs: Replace kmap() with kmap_local_page() in zstd.c

On giovedì 14 luglio 2022 02:25:20 CEST Wang Yugui wrote:
> Hi,
> 
> Compiler warning:
> 
> fs/btrfs/zstd.c:478:55: warning: passing argument 1 of ‘__kunmap_local’ 
discards ‘const’ qualifier from pointer target type [-Wdiscarded-
qualifiers]
>   478 |                         kunmap_local(workspace->in_buf.src);
> ./include/linux/highmem-internal.h:284:24: note: in definition of macro 
‘kunmap_local’
>   284 |         __kunmap_local(__addr);                                 \
>       |                        ^~~~~~
> ./include/linux/highmem-internal.h:200:41: note: expected ‘void *’ but 
argument is of type ‘const void *’
>   200 | static inline void __kunmap_local(void *addr)
>       |                                   ~~~~~~^~~~
> 
> Best Regards
> Wang Yugui (wangyugui@...-tech.com)
> 2022/07/14

Thanks for the build test, but you're a little late :)

This patch is superseded by a series of two: please see
[PATCH v6 0/2] btrfs: Replace kmap() with kmap_local_page() in zstd.c
at https://lore.kernel.org/lkml/20220706111520.12858-1-fmdefrancesco@gmail.com/

In that series, patch 1/2 changes __kunmap_{local,atomic}() prototypes to 
take pointers to const void.

Regards,

Fabio

> > The use of kmap() is being deprecated in favor of kmap_local_page(). 
With
> > kmap_local_page(), the mapping is per thread, CPU local and not 
globally
> > visible.
> > 
> > Therefore, use kmap_local_page() / kunmap_local() in zstd.c because in
> > this file the mappings are per thread and are not visible in other
> > contexts; meanwhile refactor zstd_compress_pages() to comply with 
nested
> > local mapping / unmapping ordering rules.
> > 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ