laforge submitted this change.

View Change

Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
Remove sync() after writing VTY config

Running sync() after writing VTY config causes the process to stop for
a fraction of a second. This may result in delayed processing that
causes buffer underruns, overflows and delay. This is a problem with
applications that do real-time signal processing such as osmo-trx and
osmo-bts.

After some discussions, I decided to simply remove the sync() commands
from the VTY's write function. There is still a backup file created
of the previously saved configuration before writing the current
configurtion. Loosing current configuration caused by a system crash
afterwards is very unlikely with modern file systems.

Related: OS#6438
Change-Id: I3cb2ee68b2e4c730f96522208c4abf00d0f49a44
---
M src/vty/command.c
1 file changed, 0 insertions(+), 2 deletions(-)

diff --git a/src/vty/command.c b/src/vty/command.c
index 1719690..8f87e7d 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -3451,7 +3451,6 @@
unlink(config_file_tmp);
return -3;
}
- sync();
if (unlink(config_file) != 0) {
*outpath = talloc_strdup(tall_vty_cmd_ctx, config_file);
talloc_free(config_file_sav);
@@ -3468,7 +3467,6 @@
return -5;
}
unlink(config_file_tmp);
- sync();

talloc_free(config_file_sav);
talloc_free(config_file_tmp);

To view, visit change 37798. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I3cb2ee68b2e4c730f96522208c4abf00d0f49a44
Gerrit-Change-Number: 37798
Gerrit-PatchSet: 7
Gerrit-Owner: jolly <andreas@eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-CC: Hoernchen <ewild@sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy@sysmocom.de>