On Thu, 19 May 2022 at 22:26, Eric Sandeen <sandeen(a)redhat.com> wrote:
On 5/19/22 8:18 AM, Vivek Goyal wrote:
>> Hi Vivek,
>>
>> Checking the kdump scripts, we have below, a separate "sync" command
>> is added after saving vmcore, so it would be good since that cover
>> all the core collectors, if we use fsync then we need to patch
>> makedumpfile and cp, maybe it is not necessary:
> Hi Dave,
>
> I am not sure why do we need to patch makdeumpfile or cp. Once core
> collector has saved the file, we can either do "sync -f vmcore" or
> "fsync vmcore". Isn't it?
I'm not aware of any "fsync" shell command, unfortunately. It'd be
nice.
Me too, that's why I replied before. I can not find it, man fsync
we can get fsync(2) and fsync(3), maybe it is packaged in some other
utils?
sync -f syncs the filesystem of the target file, not just the file itself -
but that's fine. [1]
so sync -f vmcore should be fine, will sync only the filesystem hosting vmcore,
and should return an error if it fails. [2]
Agreed..
-Eric
[1] syncfs() is like sync(), but synchronizes just the filesystem containing file
referred to by the open file descriptor fd.
[2] ERRORS
sync() is always successful.
syncfs() can fail for at least the following reasons: