Re: [RFC 03/10] pci/p2pdma: Don't initialise page refcount to one

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

 



Hi Alistair,

I was working on testing your patch set, however I'm dealing with some
hardware issues at the moment so I haven't fully tested everything yet.

I managed to find one issue though:

On 2024-04-10 18:57, Alistair Popple wrote:
> diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
> index fa7370f..ab7ef18 100644
> --- a/drivers/pci/p2pdma.c
> +++ b/drivers/pci/p2pdma.c
> @@ -128,6 +128,8 @@ static int p2pmem_alloc_mmap(struct file *filp, struct kobject *kobj,
>  		goto out;
>  	}
>  
> +	get_page(virt_to_page(kaddr));
> +

kaddr may represent more than one page, so this will fail to map
anything if the mapping size is greater than 4KB. There is a loop just
below this that calls vm_insert_page(). Moving a set_page_count() call
just before vm_insert_page() fixes the issue.

Thanks!

Logan




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux