Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71772 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35240 invoked from network); 30 Jan 2014 05:35:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2014 05:35:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.52 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.52 mail-la0-f52.google.com Received: from [209.85.215.52] ([209.85.215.52:44161] helo=mail-la0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/BD-52228-794E9E25 for ; Thu, 30 Jan 2014 00:35:19 -0500 Received: by mail-la0-f52.google.com with SMTP id c6so2170050lan.39 for ; Wed, 29 Jan 2014 21:35:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=mMpz9X3+ZBR1uRU4ZEjf/Xe39/KDvaJOev7SVSp5m+I=; b=A126BZeVExjlK2A0SnkxXLltQkHDdgQVlfgZrWLBiOKUl4FilsN88jejHboOQIPtzb 8mD+/CK8oAOyfXboNTN75RcBQuQmYArCRuHvQ3Q1F6jREA8AbdVgXk/kNtlU8MWGP4OE vmNaxY5EDeFTdT7ZmEodZTr3WAr8av/Y5yrQEsEFj1ecpHmiA8FqJAhXJzc6QRI1NZpS 5zO2RRx7UGp2rjJTXdGGc/FcaZrC6vWWVVrQz3/oiGi4L0qBK9naf85RZbwZOu/hgOWe lic3lWLErJeiPE1vf3yQZ9RfsbEJz/ZcM9BuoutKVgK6b+CwKjmcxm1uoUZDtgYfAsOy qjPQ== X-Received: by 10.152.163.69 with SMTP id yg5mr19716lab.33.1391060115745; Wed, 29 Jan 2014 21:35:15 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Wed, 29 Jan 2014 21:34:35 -0800 (PST) In-Reply-To: <18069656.FoN8fZuO6C@rofl> References: <52E9A631.5050808@sugarcrm.com> <18069656.FoN8fZuO6C@rofl> Date: Thu, 30 Jan 2014 14:34:35 +0900 X-Google-Sender-Auth: T4rSH3InyJe3u9AtXl7cjAqg5yk Message-ID: To: Patrick Schaaf Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11336d900f6f3c04f1296cee Subject: Re: [PHP-DEV] Re: [VOTE] Introduce session.lock, session.lazy_write and session.lazy_destory From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11336d900f6f3c04f1296cee Content-Type: text/plain; charset=UTF-8 Hi Patrick, On Thu, Jan 30, 2014 at 1:41 PM, Patrick Schaaf wrote: > First of all, the github "compare" link you give in the RFC shows a vast > amount of unrelated changed files. Playing around a bit I find that > comparing > not to php:master but to yohgaki:PHP-5.6 gives a better overview: > > > https://github.com/yohgaki/php-src/compare/PHP-5.6...PHP-5.6-rfc-session-lock > > Regarding minimize_lock: > > Generally a really dangerous feature. minimize_lock sounds so friendly, > does > not imply danger really. > > Alternative naming proposal: unlocked_thus_unsafe > It sounds good idea. How about shorter name? unsafe_lock > To solve all three problems, I'd suggest > > - unconditional taking of the flock(LOCK_EX) in ps_files_open(), while > keeping > the LOCK_UN in PS_READ_FUNC/PS_WRITE_FUNC (if minimize_lock=true). > This would be safer and good for reference implementation. > - also when minimize_lock=true, make an fstat() call in PS_WRITE_FUNC > before > the need-to-ftruncate check, ignoring data->st_size from the read. > I'll fix this later in my branch. > Reading that code, also in the base PHP repository, I think I spotted an > unrelated bug: In ps_files_open() in the not-WIN32-open_basedir > fstat/S_ISLNK > _error_ cases: data->fd is closed, but data->fd is then NOT set to -1. > This should be set to -1. I've committed the fix. Thank you. Regards. -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11336d900f6f3c04f1296cee--