Received: by 2002:a05:7412:e79e:b0:f3:1519:9f41 with SMTP id o30csp128000rdd; Wed, 22 Nov 2023 11:07:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IHvmFZTbje3IQNLY4uP24o4mNLJQwBzePHh2y8CKOOx9Dew1PBcMDtApNdCz77t2QYMsnmy X-Received: by 2002:a05:6808:1383:b0:3ab:83fe:e182 with SMTP id c3-20020a056808138300b003ab83fee182mr3785548oiw.1.1700680026362; Wed, 22 Nov 2023 11:07:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700680026; cv=none; d=google.com; s=arc-20160816; b=LoPnouc5/LAmVrxN7y/OAk872e0j8brvqv7w/6skB5wnqSqEFOXNAxxIdxOO8/GUfa ezy5399Ht6KuZ/mDhtGV8o2WRbd7JqUL1oqTKYUW26fCN5kMkEb4PlCJ/ZLOurcgBj6U 7hSdS0jLV+N3NL+f8TyjjhgZVSXUo0z/olNar37WQcINYGs/cPkUyglaHUoSFFjKus8T 9BuTj1wSiI3fmfMPE1x4PChZImwiDa3z7stW3a3iq2Kddv2d4lrxJA2/0WEWNcQedhkl IPd36eFOgFK0QAo46C1xDABKavFCDEE0kapuqMYOllON+e9UdnLUMFqidtlCc9xoQIcq E6jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=oTJs4IlC2UQTc9N/pY6A6Qg79IYXPp+EL54IbdPZeG4=; fh=20CwuCdTqc/M7aUNuGvc7MigwPvKHVIP79cSoTphTxs=; b=oLV9EkuF3Rt6y9w7jQi4SziWrvvfnLQMkFs5WFsOwfZy4H5KYnc3moXd6/GTszvwPX uX0kDj5WYUTqAKL7BLNOBUenZjI1rE2WwBm/VBFlIAWBueLOmoeD4Vpy4EWhIFMc63CW NcRnSLr69AlTrrQmeVVn6kifL+jkw1GV/NodQDl6JbPVLPJEScT+ezg55VTHQLfuOfdA iUV28CCDUkB1iHl5QOguzIyXIjusBN+pwONVL32sk+YyELyJhV0vzFq2juCFRqmxNUPl BQbKDAYsqkM29EzgESr1lzJM1R8xuxY6dWNKCrMtQvtw2Fx0GVu2aRSpBiLUn4iaoXSc oUCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=auristor.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w71-20020a63824a000000b005bdbcff21f5si57462pgd.501.2023.11.22.11.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 11:07:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=auristor.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 49DDF8027F37; Wed, 22 Nov 2023 11:06:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344487AbjKVTF5 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 22 Nov 2023 14:05:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344456AbjKVTFz (ORCPT ); Wed, 22 Nov 2023 14:05:55 -0500 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA0B1D8; Wed, 22 Nov 2023 11:05:50 -0800 (PST) Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-507bd644a96so40705e87.3; Wed, 22 Nov 2023 11:05:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700679949; x=1701284749; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c3DNU9RMxqoZMqebJLyyHcRZ4hXrYDXHtRdTf424f6I=; b=YddPqU7nhBay9bptDw5LcviTSMqpjdX0TlG0iTLzLtX2d7XQGImA2orVtGvWd/Ym0l Ezu78/bf8YHGb8Gc2W/sgKeI/7cmU9AOSMY2dlyBgbOeX6rgSr7pae1NHy60I2m5vWJY 5KlCvor0KI76E+lyhU91+0J5mPr3sOFAweS8FKWk9s2O+esbDiQSh1W2JypOc2aWNdVz GXgsiuHJCCiazFI9G7uDW8KIa+NrC47IJcpxQaf2K/DIAj0gnArouceRDpnb9UQZteve sTwasf9KALX5goH/Gv/ZqyNla+Z1nGIyxUQ9PVrPyh2vcURD/CKqqzqZ/CNh7zvKQGEV D7DQ== X-Gm-Message-State: AOJu0YxEZg0YPDRPviYj74DjiTKupyJ0SKWC4oaSCGj5IyuTVAbIZH2k +6JkBLe/kS10+jUMuzJPVfMaGI0Bvtb11A== X-Received: by 2002:a05:6512:41e:b0:4fb:9168:1fce with SMTP id u30-20020a056512041e00b004fb91681fcemr2282937lfk.59.1700679948672; Wed, 22 Nov 2023 11:05:48 -0800 (PST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com. [209.85.167.50]) by smtp.gmail.com with ESMTPSA id d8-20020a056512368800b0050097974ee0sm1944520lfs.224.2023.11.22.11.05.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Nov 2023 11:05:48 -0800 (PST) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-507ad511315so70413e87.0; Wed, 22 Nov 2023 11:05:48 -0800 (PST) X-Received: by 2002:a05:6512:15d:b0:50a:a331:27d7 with SMTP id m29-20020a056512015d00b0050aa33127d7mr2505540lfo.33.1700679948230; Wed, 22 Nov 2023 11:05:48 -0800 (PST) MIME-Version: 1.0 References: <20231116155312.156593-1-dhowells@redhat.com> <20231116155312.156593-5-dhowells@redhat.com> In-Reply-To: <20231116155312.156593-5-dhowells@redhat.com> From: Marc Dionne Date: Wed, 22 Nov 2023 15:05:37 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/5] afs: Fix file locking on R/O volumes to operate in local mode To: David Howells Cc: linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 22 Nov 2023 11:06:01 -0800 (PST) On Thu, Nov 16, 2023 at 11:53 AM David Howells wrote: > > AFS doesn't really do locking on R/O volumes as fileservers don't maintain > state with each other and thus a lock on a R/O volume file on one > fileserver will not be be visible to someone looking at the same file on > another fileserver. > > Further, the server may return an error if you try it. > > Fix this by doing what other AFS clients do and handle filelocking on R/O > volume files entirely within the client and don't touch the server. > > Fixes: 6c6c1d63c243 ("afs: Provide mount-time configurable byte-range file locking emulation") > Signed-off-by: David Howells > cc: Marc Dionne > cc: linux-afs@lists.infradead.org > --- > fs/afs/super.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/afs/super.c b/fs/afs/super.c > index 95d713074dc8..e95fb4cb4fcd 100644 > --- a/fs/afs/super.c > +++ b/fs/afs/super.c > @@ -407,6 +407,8 @@ static int afs_validate_fc(struct fs_context *fc) > return PTR_ERR(volume); > > ctx->volume = volume; > + if (volume->type != AFSVL_RWVOL) > + ctx->flock_mode = afs_flock_mode_local; > } > > return 0; Reviewed-by: Marc Dionne Marc