[node-patches] Change in ovirt-node[master]: fs: Config.exist() now also checks the file contents

fabiand at redhat.com fabiand at redhat.com
Thu Sep 17 14:05:26 UTC 2015


Fabian Deutsch has submitted this change and it was merged.

Change subject: fs: Config.exist() now also checks the file contents
......................................................................


fs: Config.exist() now also checks the file contents

Before, Config.exists() only checked if a file was persisted,
by checking that a copy resided in /config.
A situation could be encountered where the contens of the persisted
and the in-place file differed. This situation happened when
a file was persisted, the bind-mount got removed, the in-place file
got modified.
In the end the problem was that when these two files were out of
sync, but a persisted copy existsed, the files were not re-synced.
To mitigate this risk, the exists call now also checks the contents
to ensure that a out-of-sync persisted copy also counts as unpersisted.
In the end the semantics changed from "Is the file persisted?" to "Are the
contents of the file persisted?"

Example:
1. echo abc > /tmp/foo
2. persist /tmp/foo
3. unmount_config /tmp/fooo
4. echo def > /tmp/foo
5. persist /tmp/foo

Before the patch, after step 5, the contents of /config/tmp/foo
were abc, after this patch the contents are "def"

Change-Id: I10107c53aa466998fb4bfb0c9e8750f86613eaa7
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1251867
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1246117
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/utils/fs/__init__.py
1 file changed, 16 insertions(+), 17 deletions(-)

Approvals:
  Fabian Deutsch: Verified; Looks good to me, approved
  Jenkins CI: Passed CI tests



-- 
To view, visit https://gerrit.ovirt.org/46186
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I10107c53aa466998fb4bfb0c9e8750f86613eaa7
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: automation at ovirt.org



More information about the node-patches mailing list