diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-24 18:46:36 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-24 18:46:36 +0000 |
| commit | c1befbcd3eb4a51831260c7c7b743a673512e6a5 (patch) | |
| tree | 04fee08997783de473bdd69d12f6b6cfc4c2b558 /util/libreboot-utils/lib/io.c | |
| parent | 6593e76c6a17d1e0cb82a2f29e832348fa9aa5ca (diff) | |
util/nvmutil: never do cross-filesystem moves
make a local TMPDIR instead, where gbe.bin is.
this avoids the EXDEV errno, so we don't have
to handle it, and it's just better performant
for everyone.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib/io.c')
| -rw-r--r-- | util/libreboot-utils/lib/io.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/util/libreboot-utils/lib/io.c b/util/libreboot-utils/lib/io.c index de5f8c76..ef87d521 100644 --- a/util/libreboot-utils/lib/io.c +++ b/util/libreboot-utils/lib/io.c @@ -458,70 +458,6 @@ gbe_mv(void) err(errno, "TODO: cross-filesystem atomic writes currently broken"); - /* - * cross-filesystem: copy into target dir tmp - */ - - if (fs_dirname_basename(f->fname, - &dir, &base, 0) < 0) - goto ret_gbe_mv; - - dirfd = fs_open(dir, - O_RDONLY | O_DIRECTORY); - - if (dirfd < 0) - goto ret_gbe_mv; - - if (fstat(dirfd, &st_dir) < 0) - goto ret_gbe_mv; - - if (new_tmpfile_at(dirfd, &st_dir, - &dest_fd, &dest_name) < 0) - goto ret_gbe_mv; - - /* copy: tmp to local tmp */ - - rval = rw_file_exact(f->tmp_fd, f->bufcmp, - f->gbe_file_size, 0, IO_PREAD, - NO_LOOP_EAGAIN, LOOP_EINTR, - MAX_ZERO_RW_RETRY, OFF_ERR); - - if (rval < 0) - goto ret_gbe_mv; - - rval = rw_file_exact(dest_fd, f->bufcmp, - f->gbe_file_size, 0, IO_PWRITE, - NO_LOOP_EAGAIN, LOOP_EINTR, - MAX_ZERO_RW_RETRY, OFF_ERR); - - if (rval < 0) - goto ret_gbe_mv; - - if (fsync_on_eintr(dest_fd) == -1) - goto ret_gbe_mv; - - if (close_on_eintr(dest_fd) == -1) { - dest_fd = -1; - goto ret_gbe_mv; - } - dest_fd = -1; - - /* atomic replace */ - - if (fs_rename_at(dirfd, dest_name, - dirfd, base) == -1) - goto ret_gbe_mv; - - if (fsync_dir(f->fname) < 0) { - f->io_err_gbe_bin = 1; - goto ret_gbe_mv; - } - - free_if_null(&dest_name); - free_if_null(&dir); - - tmp_gbe_bin_exists = 0; - ret_gbe_mv: /* TODO: this whole section is bloat. |
