Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4774839A04A for ; Mon, 27 Apr 2026 23:19:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777331978; cv=none; b=rBYkVAuNxYvou86bdV9r1zA6g4IvPgycmusgZVukZxfnfLEWPdOEvOykm9GVn67BkZebwGbdfrRrB2P7onKdm6OBDm556hIPaPbLn1ou1rx3CA+Cpkorb203kQr2X9QjazF0m8mzTJleXcU1gCZhcMfkeWjXb5w48/OBFb8gVcU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777331978; c=relaxed/simple; bh=4G9z8ifjghfdhLglgdYtWgYb4hM11WfINVRSijRvRzQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=k0LHajgADzFud4fo0v1/E/mqtwMORqhi+ehBeBwFLASaZnWRoEM7T1mYk5BjbQqPyI5de4uBlkUoShXr9BtMsIsv+Y/86tLs08G6mUPn8NP2Lvr2v4N4puQYoLWsVy94WfToCoYa0kmB9nkaEvcBkGt9v1K/8i1xQ8RfjQzim0U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zabbo.net; spf=pass smtp.mailfrom=zabbo.net; dkim=pass (1024-bit key) header.d=zabbo.net header.i=@zabbo.net header.b=F2CMoxNH; arc=none smtp.client-ip=209.85.215.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zabbo.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zabbo.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zabbo.net header.i=@zabbo.net header.b="F2CMoxNH" Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-c7b9f54d3deso3642206a12.1 for ; Mon, 27 Apr 2026 16:19:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zabbo.net; s=google; t=1777331975; x=1777936775; darn=lists.linux.dev; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nh67nr8xZOpm8iqXICMt2lMSrigI95hzt0sToC+PlME=; b=F2CMoxNHBZCKTFZyyHLOaGQ+X59MB9bTMw1JiiegYdVuUoG+3et8GMgYatgHrR5J5G t8IwloncQvuUdgpNhFYv5ptxI9Y3Vv/3LrKRvwax/Wuq7O6pDnusU3Nm9Pc8NN7JYq8w Xi2N7axmRBoIChTuDZa00FF++JYuAZC4P1So0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777331975; x=1777936775; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nh67nr8xZOpm8iqXICMt2lMSrigI95hzt0sToC+PlME=; b=Xe773Z4Tua2eURZSW4MtVe75LvQV6WG5b/q5MfHFlE2nAr2Mb2V/swCeoGfvE12d+D 6YkbTNsSeVMv6oWIj4ai0kp+BABGlUq3r5WZRDm/iSgXgrMYAqJsdxVaFIWoMCfeSzY4 YDJNEdHx+BGM9saM03OOkCVuyGYAY6sJ4wCiBypraxLV9kx3ACHQsgJBwGSl1YzKa6RS L/24DRVntABIerMAVbhk5oo+MjdHN/U4qnKIkn70ZS2i6q/jhQbbV9w6stdNA0B+8B2E 2yFYLM7EKmrTXC1vory8KGXxGJ+o7qanJtR0Llghxg6Rwa7KDOSXPLyQFM9NMKFXoWlo mbNA== X-Gm-Message-State: AOJu0YxHHovA1sfNgbre469Ckzvq6uOnz+cX2imeLsgxJ28odxqtjys3 tRAlXDnDu+hlBrUggDIWnDUsveWwUO+L4gdvNIq5Be07w1GpzA7ihcGa67Q7lz+RUOg= X-Gm-Gg: AeBDiet16X4D5EMMBELjNrRg/95VWIsxB8ltWGnO5zMPRaMbCARWvaVlRKeh1Q4zdeF PSzQyQwxdFhE0j3EsK/j3HzvxQs7kzcIPWZEbL8xlmMzmSvbSMUYck0UiKFapkgjOmA0Bk4LkNv 1MmSC2hU4QmkctEtMTBCw4xJ+EPS0lWG75g9T+dBaU4tb+6SaiapIagxNzb6Cqdti/pYOwe06zJ Uwrj40YZYe4LTcDIqKZmkwl1H1C8bcA8VZ2S2ClgQ3EE8iT8/N10RoWUuKsxn9G2fgBcCY6fB1a 0ALOL+uRIFk7wfGceH3dCSu1Dpi7FtcuGPVTzazUl479D3kxGdphKWrzYDRyXbe/xGRjfLQMyBc t5TNpwJzAa+A/zLeQdbVO7wIp8CyRhWBgBkp4n4LsLi8+fe8Znts86LAiRoRTTL0yhjoCaMW0Mi k5sfX6TfekokRtmYuWYz9psE/6zAGBKiE= X-Received: by 2002:a05:6a20:9187:b0:39b:a48e:6a77 with SMTP id adf61e73a8af0-3a39c2581d0mr736360637.37.1777331975199; Mon, 27 Apr 2026 16:19:35 -0700 (PDT) Received: from localhost ([50.39.133.72]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c7fc2ba84a2sm350390a12.13.2026.04.27.16.19.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 16:19:34 -0700 (PDT) Date: Mon, 27 Apr 2026 16:19:34 -0700 From: Zach Brown To: Valerie Aurora Cc: rpdfs-devel@lists.linux.dev Subject: Re: [PATCH 7/8] rpdfs: add rpdfs_write_iter/rpdfs_read_iter Message-ID: <20260427231934.GG3280715@localhost.localdomain> References: <20260424140520.3443624-1-val@versity.com> <20260424140520.3443624-8-val@versity.com> Precedence: bulk X-Mailing-List: rpdfs-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260424140520.3443624-8-val@versity.com> On Fri, Apr 24, 2026 at 04:05:19PM +0200, Valerie Aurora wrote: > Implement write_iter/read_iter with generic functions. > +static ssize_t rpdfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) > +{ > + struct file *file = iocb->ki_filp; > + struct inode *inode = file_inode(file); > + int ret; > + > + rpdfs_prd("ino %llu count %lu pos %lu", > + rpdfs_inode_ino(inode), iov_iter_count(from), (unsigned long) iocb->ki_pos); > + > + ret = generic_write_checks(iocb, from); > + if (ret <= 0) > + goto out; > + > + ret = generic_perform_write(iocb, from); > +out: > + return ret; > +} This needs to refresh the inode and serialize with both local and remote writers. generic_file_write_iter() shows the pattern, but we need to serialize with the network inside of the inode_lock(). We'd copy it and nest our network locking inside the inode_lock(). This is where the block cache offering "locking" comes in. Today we'd get the inode block handle here, but we can't hold that across all of the _perform_write because that could make an enormous transaction. We should add the call that pins/unpins write mode on the inode block while it can be dirtied and written as many times as needed. - z