Re: [PATCH] fix page addr in tcmu_flush_dcache_range

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

 



On 11/18/2017 03:14 AM, tang.wenji@xxxxxxxxxx wrote:
> From: tangwenji <tang.wenji@xxxxxxxxxx>
> 
> The page addr should be update.
> 
> Signed-off-by: tangwenji <tang.wenji@xxxxxxxxxx>
> ---
>  drivers/target/target_core_user.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
> index 942d0942..82dc246 100644
> --- a/drivers/target/target_core_user.c
> +++ b/drivers/target/target_core_user.c
> @@ -470,12 +470,13 @@ static struct tcmu_cmd *tcmu_alloc_cmd(struct se_cmd *se_cmd)
>  static inline void tcmu_flush_dcache_range(void *vaddr, size_t size)
>  {
>  	unsigned long offset = offset_in_page(vaddr);
> +	void *start = vaddr - offset;
>  
>  	size = round_up(size+offset, PAGE_SIZE);
> -	vaddr -= offset;
>  
>  	while (size) {
> -		flush_dcache_page(virt_to_page(vaddr));
> +		flush_dcache_page(virt_to_page(start));
> +		start += PAGE_SIZE;
>  		size -= PAGE_SIZE;
>  	}
>  }
> 

Reviewed-by: Mike Christie <mchristi@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux