[ovs-git] Open vSwitch: ovsdb: Do not replace symlinks by regular files during compaction. (master)

dev at openvswitch.org dev at openvswitch.org
Wed Aug 1 17:59:54 UTC 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  a35ae81c6f79ab24e621a9d155538f5b88c5c2ac (commit)
       via  b1fdc5fb270c0ca21de4bbe5002aca4dd79e9911 (commit)
       via  fee0c9631470e8eb10df25544f6661d0beb43a7a (commit)
       via  8c2296a6d97ffc29c0b253eab084e92a82c198b4 (commit)
       via  f973f2af2fd4452c8e182caf6a4346cf2a2a394e (commit)
       via  01ca539f5c89fab1ea9a355d4cb75383dfb25da5 (commit)
       via  77c513a44ab85264aed7c38387ef221ad30e461c (commit)
      from  b322930908706d7db5cb5d1658c5c64f2642300a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a35ae81c6f79ab24e621a9d155538f5b88c5c2ac
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=a35ae81c6f79ab24e621a9d155538f5b88c5c2ac
Author: Ben Pfaff <blp at nicira.com>
		
ovsdb: Do not replace symlinks by regular files during compaction.
		
Signed-off-by: Ben Pfaff <blp at nicira.com>


commit b1fdc5fb270c0ca21de4bbe5002aca4dd79e9911
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=b1fdc5fb270c0ca21de4bbe5002aca4dd79e9911
Author: Ben Pfaff <blp at nicira.com>
		
lockfile: Be more forgiving about lockfiles for symlinks.
		
As the database is being transitioned from /etc to /var, there is a symlink
from the old to the new location for the database and a symlink for its
lockfile.  This works OK, but it would be more user-friendly to still work
correctly in case the symlink for the lockfile isn't there (since its
existence is non-obvious), so this commit implements that behavior.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit fee0c9631470e8eb10df25544f6661d0beb43a7a
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=fee0c9631470e8eb10df25544f6661d0beb43a7a
Author: Ben Pfaff <blp at nicira.com>
		
util: New function follow_symlinks().
		
It will acquire its first user in an upcoming commit.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 8c2296a6d97ffc29c0b253eab084e92a82c198b4
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=8c2296a6d97ffc29c0b253eab084e92a82c198b4
Author: Ben Pfaff <blp at nicira.com>
		
tests: Slightly generalize utility function tests.
		
This will allow passing arguments in for an upcoming test.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit f973f2af2fd4452c8e182caf6a4346cf2a2a394e
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=f973f2af2fd4452c8e182caf6a4346cf2a2a394e
Author: Ben Pfaff <blp at nicira.com>
		
Make the location of the database separately configurable.
		
The default is unchanged, /etc/openvswitch/conf.db.

This makes it possible to transition each Open vSwitch packaging from
/etc/openvswitch/conf.db to /var/lib/openvswitch/conf.db independently.

Signed-off-by: Ben Pfaff <blp at nicira.com>


commit 01ca539f5c89fab1ea9a355d4cb75383dfb25da5
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=01ca539f5c89fab1ea9a355d4cb75383dfb25da5
Author: Ben Pfaff <blp at nicira.com>
		
ovsdb: Make "ovsdb-tool create" work through a dangling symlink.
		
open() with O_CREAT|O_EXCL yields EEXIST if the name passed in is a
symlink, but we would like "ovsdb-tool create /etc/openvswitch/conf.db" to
work if /etc/openvswitch/conf.db is a symlink to elsewhere in the file
system.  This commit fixes the problem.  It introduces a theoretical race,
but no one should be doing "ovsdb-tool create" in parallel anyhow; O_EXCL
is just an idiot check here, not required to be fail-safe.

Debian bug #681880.
CC: 681880 at bugs.debian.org
Reported-by: Bastian Blank <waldi at debian.org>
Signed-off-by: Ben Pfaff <blp at nicira.com>
Reviewed-by: Simon Horman <horms at verge.net.au>


commit 77c513a44ab85264aed7c38387ef221ad30e461c
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=77c513a44ab85264aed7c38387ef221ad30e461c
Author: Ben Pfaff <blp at nicira.com>
		
lockfile: Fix hang locking through a dangling symlink.
		
open() with O_CREAT|O_EXCL yields EEXIST if the file being opened is a
symlink.  lockfile_try_lock() interpreted that error code to mean that
some other process had created the lock file in the meantime, so it went
around its loop again, which found out the same thing, which led to a hang.

This commit fixes the problem by dropping O_EXCL.  I don't see any reason
that it's actually necessary.  That means that the loop itself is
unnecessary, so this commit drops that too.

Debian bug #681880.
CC: 681880 at bugs.debian.org
Reported-by: Bastian Blank <waldi at debian.org>
Signed-off-by: Ben Pfaff <blp at nicira.com>
Reviewed-by: Simon Horman <horms at verge.net.au>


-----------------------------------------------------------------------

Summary of changes:
 Makefile.am                                        |    1 +
 configure.ac                                       |    1 +
 lib/automake.mk                                    |    2 +
 lib/dirs.c.in                                      |    9 ++-
 lib/dirs.h                                         |    3 +-
 lib/lockfile.c                                     |   79 +++++++--------
 lib/util.c                                         |   85 +++++++++++++++++
 lib/util.h                                         |    3 +
 m4/openvswitch.m4                                  |   10 ++
 ovsdb/file.c                                       |    7 +-
 ovsdb/log.c                                        |   13 ++-
 ovsdb/ovsdb-server.1.in                            |    2 +-
 ovsdb/ovsdb-server.c                               |    2 +-
 ovsdb/ovsdb-tool.1.in                              |    2 +-
 ovsdb/ovsdb-tool.c                                 |   24 +++--
 python/automake.mk                                 |    1 +
 python/ovs/dirs.py                                 |    1 +
 tests/file_name.at                                 |   97 +++++++++++++++++++
 tests/library.at                                   |   15 ++-
 tests/lockfile.at                                  |    2 +
 tests/ofproto-macros.at                            |    3 +-
 tests/ovs-monitor-ipsec.at                         |    1 +
 tests/ovs-xapi-sync.at                             |    1 +
 tests/ovsdb-server.at                              |   15 +++-
 tests/ovsdb-tool.at                                |   17 +++-
 tests/test-lockfile.c                              |   68 +++++++++++++-
 tests/test-util.c                                  |   99 +++++++++++++------
 tests/unixctl-py.at                                |    2 +
 tests/vlog.at                                      |    4 +
 utilities/bugtool/ovs-bugtool.in                   |    4 +-
 .../bugtool/plugins/system-logs/openvswitch.xml    |    3 +-
 utilities/ovs-ctl.8                                |    3 +-
 utilities/ovs-ctl.in                               |    7 +-
 utilities/ovs-lib.in                               |    2 +
 34 files changed, 482 insertions(+), 106 deletions(-)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list