Bug 94849 - [ufs] rename on UFS filesystem is not atomic
Summary: [ufs] rename on UFS filesystem is not atomic
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 6.1-PRERELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-23 02:20 UTC by Kris Kennaway
Modified: 2022-01-24 14:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kris Kennaway freebsd_committer freebsd_triage 2006-03-23 02:20:17 UTC
When more than one rename() operation on the same source file executes
on multiple CPUs at once, more than one operation may return success.

How-To-Repeat: 
Use the simul filesystem analysis tool:

   ftp://ftp.llnl.gov/pub/siop/simul/

(I'll add a port for this soon)

Tracing the operations with AUDIT, shows

header,153,1,rename(2),0,Thu Mar  9 15:52:21 2006, + 40 msec
path,/c/test/simul_rename.0
attribute,644,root,wheel,78,2175369,0
path,/c/test/simul_rename_new.1
subject,-1,root,wheel,root,wheel,58428,0,0,0.0.0.0
return,success,0
trailer,153
header,153,1,rename(2),0,Thu Mar  9 15:52:21 2006, + 40 msec
path,/c/test/simul_rename.0
attribute,644,root,wheel,78,2175369,0
path,/c/test/simul_rename_new.0
subject,-1,root,wheel,root,wheel,58422,0,0,0.0.0.0
return,success,0
trailer,153

i.e., rename(/c/test/simul_rename.0,/c/test/simul_rename_new.0) and
rename(/c/test/simul_rename.0,/c/test/simul_rename_new.1) were
executed simultaneously on this dual-CPU machine, and both succeeded.
The result is:

2175369 -rw-r--r--  2 root  wheel      0 Mar  9 15:52 simul_rename_new.0
2175369 -rw-r--r--  2 root  wheel      0 Mar  9 15:52 simul_rename_new.1

Similar bugs involving other filesystem operations exist when
operations are performed in parallel on an NFS client; on NFS client
and server at once; and on nullfs upper/lower layers at once (and
probably other filesystems).  This is the only problem I have found on
UFS so far.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-05-18 04:02:44 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:00 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped