From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83F1915F3FF; Sun, 24 Nov 2024 22:34:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732487698; cv=none; b=u8lyGN03K5BFJnaXSpZNG+yT/ogLPpegeSZUc7W5cl4Jw2fkdoiwooA+KsLrFuwZUTILmdZrR3zgtfuAjFRd0F0s8nZEgXoc4xsdUtTVkv6L6x9y9BpcY6xHWvpphraX1tGDeBWXUCePLxPut9fNKuXlrIy7vPps+/XSFus9MBU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732487698; c=relaxed/simple; bh=s+rOOU1n30WbMHTTglw6fhdjGiwDea+Z5nnW6PRNquU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sMx8f6kxR5JEaH9xdCtZ6qCUaJyCXGqpUUuXrFKODgD8lwuYYQ3mllqsR+/ASAPkUOEiON3LlRQJDrit12jaZC4Fmzicrj+4owwy3NHZlNL+Fdf+xEXZgbeEKSCpSVdRfy8m7p/q8rfplaYIZ0ejX+/GDCqfX7jwvmFNzDyFRkQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=N2mH134/; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="N2mH134/" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Kb1lUUE4FLlwB3StPCrJvFMctiJp+GPXX3AwqlY/5bs=; b=N2mH134/zpb33+gN3IItJdDS7L BHWjED5agtUwzs8PZj5hSRf9/HdJy26ACbmybWtPNcKCebqVtaDr26t+RdikaaX3bQjMnSEJ/or99 N7Umt948VC8PCmWP4tzAAyxLSP/LwEBOB6Fo6ousGnVyeZNhiaFT6gzfke5PPpFiXdo5iHa/3V9Qa J169liCJ1fvaSiR7CZcY4kYTMTYceh2Jmpt4nj3OJXwWtyaJRHK0K6YPJzOQ9mjpAzMH1uthO9K9D uxhOJR3WkSfFtKT/kDMc+zmTyTq57zdspaO7zSInfjFLG9Nwt2jrGENFqdNNARQWDo94yCN50XbxP PnfjTKXA==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tFLBr-0000000B0tB-0OER; Sun, 24 Nov 2024 22:34:51 +0000 Date: Sun, 24 Nov 2024 22:34:50 +0000 From: Matthew Wilcox To: Al Viro Cc: Linus Torvalds , Mateusz Guzik , "Darrick J. Wong" , Hao-ran Zheng , brauner@kernel.org, jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, baijiaju1990@gmail.com, 21371365@buaa.edu.cn Subject: Re: [RFC] metadata updates vs. fetches (was Re: [PATCH v4] fs: Fix data race in inode_set_ctime_to_ts) Message-ID: References: <61292055a11a3f80e3afd2ef6871416e3963b977.camel@kernel.org> <20241124094253.565643-1-zhenghaoran@buaa.edu.cn> <20241124174435.GB620578@frogsfrogsfrogs> <20241124215014.GA3387508@ZenIV> <20241124222450.GB3387508@ZenIV> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241124222450.GB3387508@ZenIV> On Sun, Nov 24, 2024 at 10:24:50PM +0000, Al Viro wrote: > On Sun, Nov 24, 2024 at 02:10:30PM -0800, Linus Torvalds wrote: > > I *do* think that we could perhaps extend (and rename) the > > inode->i_size_seqcount to just cover all of the core inode metadata > > stuff. > > That would bring ->i_size_seqcount to 64bit architectures and > potentially extend the time it's being held quite a bit even > on 32bit... Could we just do: again: nsec = READ_ONCE(inode->nsec) sec = READ_ONCE(inode->sec) if (READ_ONCE(inode->nsec) != nsec) goto again; ?