public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* How does EXT4 ensures two processes don't modify and synchronize one page at the same time.
@ 2022-01-24 17:17 Lyu Tao
  2022-01-24 18:23 ` Theodore Y. Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Lyu Tao @ 2022-01-24 17:17 UTC (permalink / raw)
  To: linux-ext4@vger.kernel.org

Hi,

I'm new to file system area and have a naive question about the global sync.

Let's suppose there are two process are writing to the same file. If one process issues a sync() syscall, which mechanism can ensures the two processes don't modify and synchronize one page at the same time.

Best,
Tao

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How does EXT4 ensures two processes don't modify and synchronize one page at the same time.
  2022-01-24 17:17 How does EXT4 ensures two processes don't modify and synchronize one page at the same time Lyu Tao
@ 2022-01-24 18:23 ` Theodore Y. Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Y. Ts'o @ 2022-01-24 18:23 UTC (permalink / raw)
  To: Lyu Tao; +Cc: linux-ext4@vger.kernel.org

On Mon, Jan 24, 2022 at 05:17:34PM +0000, Lyu Tao wrote:
> 
> I'm new to file system area and have a naive question about the global sync.
> 
> Let's suppose there are two process are writing to the same file. If
> one process issues a sync() syscall, which mechanism can ensures the
> two processes don't modify and synchronize one page at the same
> time.

That's not what the sync() system call purports to do.  To quote from
the sync(2) man page:

       sync() causes all pending modifications to filesystem metadata
       and cached file data to be written to the underlying
       filesystems.

						- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-24 18:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-24 17:17 How does EXT4 ensures two processes don't modify and synchronize one page at the same time Lyu Tao
2022-01-24 18:23 ` Theodore Y. Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox