Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D50AB18AB4 for ; Wed, 24 Jun 2015 07:41:40 +0000 (UTC) Received: (qmail 2340 invoked by uid 500); 24 Jun 2015 07:41:40 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 2287 invoked by uid 500); 24 Jun 2015 07:41:40 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 2277 invoked by uid 99); 24 Jun 2015 07:41:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jun 2015 07:41:40 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of brane@wandisco.com designates 209.85.212.178 as permitted sender) Received: from [209.85.212.178] (HELO mail-wi0-f178.google.com) (209.85.212.178) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jun 2015 07:39:25 +0000 Received: by wiwl6 with SMTP id l6so86975789wiw.0 for ; Wed, 24 Jun 2015 00:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wandisco.com; s=gapps; h=message-id:date:from:organization:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=D1nbH0R2dib7AIJgAOywMx3dmpbHncCT2s4rSSp0LWU=; b=lokGydboDd/U99iJpS342jFSdlCjSDA8TcNuTgnXqX9pa+Z4o/ubS+GCSDw1nWR3EH ScZaDWiCu0qyxm41RLf5SYMTN0TN5If72gI/ZtKR7YTk7XyZbuOdRtsVDHxNckHEB7Fi 5WCdl7CtNbHC7GZvPr3QLPrOHtJ2AGCCfESqo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=D1nbH0R2dib7AIJgAOywMx3dmpbHncCT2s4rSSp0LWU=; b=FsFtFKzHZaT2g5etubr1kImEHR413FNocJwxVtnT/cxGdaEyQFwPWSg60+C2Biwlyr gD48cPfNbXs1pmXFF5cvNij9EaJb0pDfrYj4A6t9OQ2DTKOmbvqeFfZ5LuPUqvDf7Iz4 PshQEslaZ1mVyrTzcOlBV4EI0GeLlrlmXzZDdQuWAy79W20vqJ7Qvbl7uagZmYennLf3 DadyMx86ROoXkxcA7GNnzPLq/zZaINvOGwnsAHnT3X4fkUiQ1+rEK7sn/RYJHe+Kj1c/ gAOZj/FYuj1stjftMU7giZfhQjXA+6l61M5D0yEyqMCZF8YzfJJc0qgF/vPMnQX7TqqL TYWA== X-Gm-Message-State: ALoCoQnA6yiDh4HtbSIJnHjnRu+IWWdq7369m3jnvkhpAY0CDaxJ2VkJDY1uj+WPGru0+FiGHv6X X-Received: by 10.180.86.234 with SMTP id s10mr2271733wiz.50.1435131672681; Wed, 24 Jun 2015 00:41:12 -0700 (PDT) Received: from zulu.local (sweeney.stsp.name. [217.197.84.22]) by mx.google.com with ESMTPSA id ul1sm39297276wjc.30.2015.06.24.00.41.11 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 24 Jun 2015 00:41:11 -0700 (PDT) Received: from zulu.local (localhost [127.0.0.1]) by zulu.local (Postfix) with ESMTP id 59C62ED5D55B for ; Wed, 24 Jun 2015 09:41:10 +0200 (CEST) Message-ID: <558A5F16.7080700@wandisco.com> Date: Wed, 24 Jun 2015 09:41:10 +0200 From: =?UTF-8?B?QnJhbmtvIMSMaWJlag==?= Organization: WANdisco User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: dev@subversion.apache.org Subject: Re: svn commit: r1682265 - /subversion/trunk/subversion/libsvn_fs_fs/util.c References: <20150528154555.D1D0BAC06F9@hades.apache.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 23.06.2015 19:29, Ivan Zhakov wrote: > > I've prepared a patch that fixes svn_io_file_rename() to consistently > return error for cross volume renames on Windows using platform > specific code. See svn-rename-no-copy-allowed-v1.patch.txt. > Review/testing will be really appreciated since it contains platform > specific code. > > While I think that we should generally avoid platform specific code, > in this case using the native API gives us an opportunity to use > MOVEFILE_WRITE_THROUGH flag for MoveFileEx later to avoid potential > problems on network shares and non-NTFS filesystems. > > I've also prepared patch for APR that changes apr_file_rename() > behavior to fail for cross-volume renames on Windows (see > apr-file-rename-no-copy-allowed-v1.patch), but I'm not sure that it > could be committed to APR (and backported to release branches) since > it changes behavior and some APR users may depend on current behavior. > Index: subversion/libsvn_subr/io.c > ======================================= > --- subversion/libsvn_subr/io.c (revision 1687052) > +++ subversion/libsvn_subr/io.c (working copy) > @@ -4024,7 +4024,25 @@ > return SVN_NO_ERROR; > } > +#if defined(WIN32) > +/* Compatibility wrapper around apr_file_rename() to workaround > + APR problems on Windows. */ This isn't really a wrapper for apr_file_rename at all, is it? > +static apr_status_t > +win32_file_rename(const WCHAR *from_path_w, > + const WCHAR *to_path_w, > + apr_pool_t *pool) > +{ > + /* APR calls MoveFileExW() with MOVEFILE_COPY_ALLOWED, while we rely > + * that rename is atomic operation. Use MoveFileEx directly on Windows > + * without MOVEFILE_COPY_ALLOWED flag to workaround it. > + */ > + if (!MoveFileExW(from_path_w, to_path_w, MOVEFILE_REPLACE_EXISTING)) > + return apr_get_os_error(); > + return APR_SUCCESS; > +} > +#endif > + The rest of the patch looks good. I wonder though if we shouldn't just rip out OS/2-specific bits ... is that thing still alive and is it remotely possible that someone's running Subversion on OS/2? Regarding the APR patch: IMO it should go into APR 2.0 (that's trunk) but, as you say, can't be backported to the 1.x series. -- Brane