As other examples show, read lock suffices although pages are being written later on.
Signed-off-by: Phil Sutter <phil.sut...@viprinet.com> --- zc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zc.c b/zc.c index db28b58..884dbab 100644 --- a/zc.c +++ b/zc.c @@ -58,10 +58,10 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write, return 0; } - down_write(&mm->mmap_sem); + down_read(&mm->mmap_sem); ret = get_user_pages(task, mm, (unsigned long)addr, pgcount, write, 0, pg, NULL); - up_write(&mm->mmap_sem); + up_read(&mm->mmap_sem); if (ret != pgcount) return -EINVAL; -- 1.7.8.6 _______________________________________________ Cryptodev-linux-devel mailing list Cryptodev-linux-devel@gna.org https://mail.gna.org/listinfo/cryptodev-linux-devel