Re: [PATCH 13/18] exec: make exec path waiting for mmap_sem killable

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

 



On 02/29, Michal Hocko wrote:
>
> @@ -267,7 +267,10 @@ static int __bprm_mm_init(struct linux_binprm *bprm)
>  	if (!vma)
>  		return -ENOMEM;
>  
> -	down_write(&mm->mmap_sem);
> +	if (down_write_killable(&mm->mmap_sem)) {
> +		err = -EINTR;
> +		goto err_free;
> +	}
>  	vma->vm_mm = mm;

I won't argue, but this looks unnecessary. Nobody else can see this new mm,
down_write() can't block.

In fact I think we can just remove down_write/up_write here. Except perhaps
there is lockdep_assert_held() somewhere in these paths.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux