Re: [PATCH 08/18] mm, fork: make dup_mmap wait for mmap_sem for write killable

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

 



On 02/29, Michal Hocko wrote:
>
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -413,7 +413,10 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
>  	unsigned long charge;
>  
>  	uprobe_start_dup_mmap();
> -	down_write(&oldmm->mmap_sem);
> +	if (down_write_killable(&oldmm->mmap_sem)) {
> +		uprobe_end_dup_mmap();
> +		return -EINTR;
> +	}

This is really cosmetic and subjective, I won't insist if you prefer it this way.

But perhaps it makes sense to add another "fail" label above uprobe_end_dup_mmap()
we already have... IMO it is always better to avoid duplicating when it comes to
"unlock".

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