Skip to content

Conversation

@lxbsz
Copy link
Collaborator

@lxbsz lxbsz commented Apr 29, 2019

In-case if the editor (vim) follows write to a new file (.swp, .tmp ..)
and move it to actual file name later. There is a window, where we will
encounter one case that the file data is not flushed to the disk, so in
another process(here) when reading it will be empty.

Let just wait and try again.

Signed-off-by: Xiubo Li [email protected]

… out

In-case if the editor (vim) follows write to a new file (.swp, .tmp ..)
and move it to actual file name later. There is a window, where we will
encounter one case that the file data is not flushed to the disk, so in
another process(here) when reading it will be empty.

Let just wait and try again.

Signed-off-by: Xiubo Li <[email protected]>
return -ENOMEM;

retry:
count++;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the tabbing/spacing got messed up for the count++ line.

*/
if (count <= 5 && (len == 0 || ret == -ENOENT)) {
tcmu_dbg("failed to read the config from file, retrying (%d/5) times\n",
count);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for the "count);" line here. I think the tabbing/spacing got messed up.

@lxbsz lxbsz changed the base branch from master to main August 10, 2022 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants