Debian Bug report logs - #461585
locate: strange interpretation of atomic

version graph

Package: locate; Maintainer for locate is Andreas Metzler <ametzler@debian.org>; Source for locate is src:findutils (PTS, buildd, popcon).

Reported by: Justin Pryzby <jpryzby+d@quoininc.com>

Date: Sat, 19 Jan 2008 18:42:01 UTC

Severity: normal

Found in version 4.2.41-4

Fixed in version findutils/4.3.13-1

Done: Andreas Metzler <ametzler@debian.org>

Bug is archived. No further changes may be made.

Forwarded to http://savannah.gnu.org/bugs/?22057

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Andreas Metzler <ametzler@debian.org>:
Bug#461585; Package locate. (full text, mbox, link).


Acknowledgement sent to Justin Pryzby <jpryzby+d@quoininc.com>:
New Bug report received and forwarded. Copy sent to Andreas Metzler <ametzler@debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Justin Pryzby <jpryzby+d@quoininc.com>
To: submit@bugs.debian.org
Subject: locate: strange interpretation of atomic
Date: Sat, 19 Jan 2008 13:38:50 -0500
Package: locate
Version: 4.2.41-4

An atomic rename involves a "mv" without an "rm", with the chmod on
the .n file beforehand.

|# To reduce the chances of breaking locate while this script is running,
|# put the results in a temp file, then rename it atomically.
|if test -s $LOCATE_DB.n; then
|  rm -f $LOCATE_DB
|  mv $LOCATE_DB.n $LOCATE_DB
|  chmod 644 $LOCATE_DB
|else




Noted your statement that Bug has been forwarded to http://savannah.gnu.org/bugs/?22057. Request was from Andreas Metzler <ametzler@debian.org> to control@bugs.debian.org. (Sat, 19 Jan 2008 19:09:04 GMT) (full text, mbox, link).


Message sent on to Justin Pryzby <jpryzby+d@quoininc.com>:
Bug#461585. (full text, mbox, link).


Message #10 received at 461585-submitter@bugs.debian.org (full text, mbox, reply):

From: Andreas Metzler <INVALID.NOREPLY@gnu.org>
To: Andreas Metzler <gnu@downhill.at.eu.org>, 461585-submitter@bugs.debian.org, bug-findutils@gnu.org
Subject: [bug #22057] updatedb "atomic rename" is not atomic
Date: Sat, 19 Jan 2008 19:04:44 +0000
URL:
  <http://savannah.gnu.org/bugs/?22057>

                 Summary: updatedb "atomic rename" is not atomic
                 Project: findutils
            Submitted by: ametzler
            Submitted on: Samstag 19.01.2008 um 20:04
                Category: updatedb
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Justin Pryzby
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None
           Fixed Release: None

    _______________________________________________________

Details:

This is http://bugs.debian.org/461585

8X-----------------------------------
An atomic rename involves a "mv" without an "rm", with the chmod on
the .n file beforehand.

|# To reduce the chances of breaking locate while this script is running,
|# put the results in a temp file, then rename it atomically.
|if test -s $LOCATE_DB.n; then
|  rm -f $LOCATE_DB
|  mv $LOCATE_DB.n $LOCATE_DB
|  chmod 644 $LOCATE_DB
|else
8X-----------------------------------

I am forwarding this, since I am undecided whether this is actually a bug.
Replacing

rm ; mv ; chmod

with 

chmod 644 $LOCATE_DB.n
mv $LOCATE_DB.n $LOCATE_DB

has the bonus that $LOCATE_DB is present all the time. The downside is that
an already running locate process might act strangely if its input data is
changing.

cu andreas




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?22057>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/





Information forwarded to debian-bugs-dist@lists.debian.org, Andreas Metzler <ametzler@debian.org>:
Bug#461585; Package locate. (full text, mbox, link).


Acknowledgement sent to Justin Pryzby <jpryzby+d@quoininc.com>:
Extra info received and forwarded to list. Copy sent to Andreas Metzler <ametzler@debian.org>. (full text, mbox, link).


Message #15 received at 461585@bugs.debian.org (full text, mbox, reply):

From: Justin Pryzby <jpryzby+d@quoininc.com>
To: 461585@bugs.debian.org, bug-findutils@gnu.org
Subject: Re: Bug#461585: [bug #22057] updatedb "atomic rename" is not atomic
Date: Sat, 19 Jan 2008 16:01:17 -0500
On Sat, Jan 19, 2008 at 07:04:44PM +0000, Andreas Metzler wrote:
> 
> Details:
> 
> This is http://bugs.debian.org/461585
> 
> 8X-----------------------------------
> An atomic rename involves a "mv" without an "rm", with the chmod on
> the .n file beforehand.
> 
> |# To reduce the chances of breaking locate while this script is running,
> |# put the results in a temp file, then rename it atomically.
> |if test -s $LOCATE_DB.n; then
> |  rm -f $LOCATE_DB
> |  mv $LOCATE_DB.n $LOCATE_DB
> |  chmod 644 $LOCATE_DB
> |else
> 8X-----------------------------------
> 
> I am forwarding this, since I am undecided whether this is actually a bug.
> Replacing
> 
> rm ; mv ; chmod
> 
> with 
> 
> chmod 644 $LOCATE_DB.n
> mv $LOCATE_DB.n $LOCATE_DB
> 
> has the bonus that $LOCATE_DB is present all the time. The downside is that
> an already running locate process might act strangely if its input data is
> changing.
It shouldn't act strangely, since it does fopen(), so locate sees the
instance of the file that exists at that point in time (and the file
descriptor prevents the kernel from "really" removing the file until
it's fclosed).




Message sent on to Justin Pryzby <jpryzby+d@quoininc.com>:
Bug#461585. (full text, mbox, link).


Message #18 received at 461585-submitter@bugs.debian.org (full text, mbox, reply):

From: James Youngman <INVALID.NOREPLY@gnu.org>
To: James Youngman <jay@gnu.org>, 461585-submitter@bugs.debian.org, bug-findutils@gnu.org
Subject: [bug #22057] updatedb "atomic rename" is not atomic
Date: Fri, 25 Jan 2008 21:46:24 +0000
Update of bug #22057 (project findutils):

                  Status:                    None => In Progress            
             Assigned to:                    None => jay                    
                 Release:                    None => 4.3.12                 

    _______________________________________________________

Follow-up Comment #1:

Running instances of locate will not notice, due to the semantics of Unix
filesystems.  

The resut may not be portable to Cygwin, but I think that's a matter best
dealt with - if necessary - by patches in the Cygwin port.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?22057>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





Message sent on to Justin Pryzby <jpryzby+d@quoininc.com>:
Bug#461585. (full text, mbox, link).


Message #21 received at 461585-submitter@bugs.debian.org (full text, mbox, reply):

From: James Youngman <INVALID.NOREPLY@gnu.org>
To: James Youngman <jay@gnu.org>, 461585-submitter@bugs.debian.org, bug-findutils@gnu.org
Subject: [bug #22057] updatedb "atomic rename" is not atomic
Date: Sat, 09 Feb 2008 10:17:22 +0000
Update of bug #22057 (project findutils):

                  Status:             In Progress => Fixed                  

    _______________________________________________________

Follow-up Comment #2:

Fixed in 4.3.x.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?22057>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





Message sent on to Justin Pryzby <jpryzby+d@quoininc.com>:
Bug#461585. (full text, mbox, link).


Message #24 received at 461585-submitter@bugs.debian.org (full text, mbox, reply):

From: James Youngman <INVALID.NOREPLY@gnu.org>
To: James Youngman <jay@gnu.org>, 461585-submitter@bugs.debian.org, bug-findutils@gnu.org
Subject: [bug #22057] updatedb "atomic rename" is not atomic
Date: Thu, 14 Feb 2008 11:10:20 +0000
Update of bug #22057 (project findutils):

             Open/Closed:                    Open => Closed                 
           Fixed Release:                    None => 4.3.13                 


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?22057>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





Reply sent to Andreas Metzler <ametzler@debian.org>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Justin Pryzby <jpryzby+d@quoininc.com>:
Bug acknowledged by developer. (full text, mbox, link).


Message #29 received at 461585-close@bugs.debian.org (full text, mbox, reply):

From: Andreas Metzler <ametzler@debian.org>
To: 461585-close@bugs.debian.org
Subject: Bug#461585: fixed in findutils 4.3.13-1
Date: Sat, 01 Mar 2008 12:47:03 +0000
Source: findutils
Source-Version: 4.3.13-1

We believe that the bug you reported is fixed in the latest version of
findutils, which is due to be installed in the Debian FTP archive:

findutils_4.3.13-1.diff.gz
  to pool/main/f/findutils/findutils_4.3.13-1.diff.gz
findutils_4.3.13-1.dsc
  to pool/main/f/findutils/findutils_4.3.13-1.dsc
findutils_4.3.13-1_i386.deb
  to pool/main/f/findutils/findutils_4.3.13-1_i386.deb
findutils_4.3.13.orig.tar.gz
  to pool/main/f/findutils/findutils_4.3.13.orig.tar.gz
locate_4.3.13-1_i386.deb
  to pool/main/f/findutils/locate_4.3.13-1_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 461585@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Metzler <ametzler@debian.org> (supplier of updated findutils package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat, 01 Mar 2008 12:34:04 +0100
Source: findutils
Binary: findutils locate
Architecture: source i386
Version: 4.3.13-1
Distribution: experimental
Urgency: low
Maintainer: Andreas Metzler <ametzler@debian.org>
Changed-By: Andreas Metzler <ametzler@debian.org>
Description: 
 findutils  - utilities for finding files--find, xargs
 locate     - maintain and query an index of a directory tree
Closes: 459570 460733 461585
Changes: 
 findutils (4.3.13-1) experimental; urgency=low
 .
   * New upstream version.
     #22057: Actually rename the old locate database to the new one
     atomically, instead of just claiming the rename is atomic in a
     comment. Closes: #461585
     #22056: -Xtime tests are off by one second (e.g. rm -f x; touch x;
     find x -mtime 0 should print x). Closes: #460733
   * merge from 4.2.x:
     - Add Vcs-Svn, Vcs-Browser and Homepage control fields.
     - Try to preserve user changes of updatedb.conf on upgrading from
       findutils versions with included locate: If updatedb.conf is user
       modified and /etc/updatedb.findutils.cron.local does not yet exist,
       generate the latter from the former. Closes: #459570
   * Upstream's documentation licensing has been fixed, update
     debian/copyright.
Files: 
 1b658e94bf5f2f102b2f873a1c053b3c 840 utils required findutils_4.3.13-1.dsc
 90ef3353f78c62eb8a3b2fb6c0127034 2054988 utils required findutils_4.3.13.orig.tar.gz
 0215f4957e822637c8a4a06272d8548b 19074 utils required findutils_4.3.13-1.diff.gz
 4e227b7ff40d55b30c4195a2cd6cda61 517188 utils required findutils_4.3.13-1_i386.deb
 fa7e446876c9ee13a336f5edd997b16a 147128 utils optional locate_4.3.13-1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHyU0CHTOcZYuNdmMRAlL2AJ9iTR9l2K0FTVEy8B3vNokK9t+FcACdGuX3
EtpqOSnmEVCHadDrwXu25rY=
=bbH/
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 30 Mar 2008 07:35:18 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Dec 23 16:40:01 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.