[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZozSlCGyKCkj3uUl@infradead.org>
Date: Mon, 8 Jul 2024 23:03:00 -0700
From: Christoph Hellwig <hch@...radead.org>
To: George Stark <gnstark@...utedevices.com>
Cc: linux-kernel@...r.kernel.org, kernel@...utedevices.com
Subject: Re: [PATCH 1/1] initrd: use O_SYNC flag while opening /dev/ram for
write
On Mon, Jul 08, 2024 at 11:09:23PM +0300, George Stark wrote:
> initrd image is written to the /dev/ram block device using filp_open(),
> kernel_write()
First question: why are you using the legacy initrd and not initramfs?
> . After fput() /dev/ram is mounted and may fail due to not
> all data is actually written to the device yet. The mount error remains
> hidden due to MS_SILENT flag usage and mount_root_generic has retries.
> So use O_SYNC flag to have all data written to /dev/ram before mounting.
O_SYNC is highly inefficient. If you have a valid reason to care about
a corner case in the hopefully soon to be remvoved legacy initrd code,
the right way to do this is a single fdatasync after the writes have
finished.
Powered by blists - more mailing lists