Re: [PATCH v5 1/2] Use kmap_atomic when rewriting attached page

From: Christoph Hellwig
Date: Thu Aug 11 2016 - 10:13:42 EST


> +static unsigned int ata_format_dsm_trim_descr(struct scatterlist *sg, u32 num,
> + u64 sector, u32 count)
> +{
> + void *ptr = kmap_atomic(sg_page(sg));


Please use sg_copy_from_buffer to be safe against all corner cases.