Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3544336pxb; Mon, 24 Jan 2022 11:52:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8KDP7JxzpJzY9MiGds1+1aSplaBCynhU+/qnUdJp0dFYherUjU5IJwkGVBB42m4FuUOjP X-Received: by 2002:a17:902:74c4:b0:14a:d5f6:1f1c with SMTP id f4-20020a17090274c400b0014ad5f61f1cmr15756071plt.56.1643053948620; Mon, 24 Jan 2022 11:52:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643053948; cv=none; d=google.com; s=arc-20160816; b=pCSFf7hvAGw6RMzKTEAPjwlMzFItwV+FOCg5hZ4stxBuae3Fvu5phafLD488dnuaZj mSWM2M51qIavJ3ANLRHHDq3qLXWdZoTGDTJqPyKociGwGXKpmhqw17OMUjAFrCsn2Fmt Yr0NvGjQdE2F2ikVT8fr9HWPitFl7G3AZUerqQrSGWXvNS3ct1toF/4rSVcJMzJZM4um 7npLn5pjERclj/eNxYoxJUoEuh2QpC6oVOThSnBG/w3b7fugTxNuUfrGvZR3RAm1ygVh tbXkuO8ffW7OTcpuH05+cBN5T3VaxklREiJvEJIYC1adZAXUlhFrVPUgf+XBwrsze1CP Ba6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=bViS/4NDCpWe20qnnk/a/y3UevvhQuaValTZeOVpU1A=; b=OGycS74xYCjkLfCXYNtooMxL8AD7HSbGW6fswvfdyiHifptcMzPpjlTKjb4IMKuhuR VM9CHUbUZigsgTKLytvoKjjWg9it83E2hAJd1MglWVv9/vfQ4mnCjjyQSf2SVkaHxQ1g Xl2SFST5d2vBEsNWotxVKVt9blZwvRqB/oL5bHbXZgYI/siJOFmwB8mecxkB+3q7NytD DGIa3oAWfpO3oj2jz8DKPaI1kVDnoKxa11lT/GCXj+lh32tD5QsvZBmQAZBzlXdG317S j95PQGJRHEJFcHIu1OrQH4uuzNJxA0PzaUm1S6IXp2kY6N+CltqSBQr0mtC0P5VtOmq5 28Zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n88si249843pji.26.2022.01.24.11.52.11; Mon, 24 Jan 2022 11:52:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241782AbiAXSX3 (ORCPT + 99 others); Mon, 24 Jan 2022 13:23:29 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:58042 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235901AbiAXSX2 (ORCPT ); Mon, 24 Jan 2022 13:23:28 -0500 Received: from callcc.thunk.org (guestnat-104-133-8-106.corp.google.com [104.133.8.106] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 20OINM5s029075 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 24 Jan 2022 13:23:23 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 7201342011A; Mon, 24 Jan 2022 13:23:21 -0500 (EST) Date: Mon, 24 Jan 2022 13:23:21 -0500 From: "Theodore Y. Ts'o" To: Lyu Tao Cc: "linux-ext4@vger.kernel.org" Subject: Re: How does EXT4 ensures two processes don't modify and synchronize one page at the same time. Message-ID: References: <6fdeab9535134fc18e86968b10e726c6@epfl.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6fdeab9535134fc18e86968b10e726c6@epfl.ch> Precedence: bulk List-ID: X-Mailing-List: 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