linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Dionne <marc.dionne@auristor.com>
To: David Howells <dhowells@redhat.com>
Cc: linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] afs: Fix file locking on R/O volumes to operate in local mode
Date: Wed, 22 Nov 2023 15:05:37 -0400	[thread overview]
Message-ID: <CAB9dFds4+gxWidvxWBU8PNO+wiLO0CkpudahjrymFxj5U_qXoQ@mail.gmail.com> (raw)
In-Reply-To: <20231116155312.156593-5-dhowells@redhat.com>

On Thu, Nov 16, 2023 at 11:53 AM David Howells <dhowells@redhat.com> 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 <dhowells@redhat.com>
> cc: Marc Dionne <marc.dionne@auristor.com>
> 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.dionne@auristor.com>

Marc

  reply	other threads:[~2023-11-22 19:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16 15:53 [PATCH 0/5] afs: Miscellaneous small fixes David Howells
2023-11-16 15:53 ` [PATCH 1/5] afs: Fix afs_server_list to be cleaned up with RCU David Howells
2023-11-17 15:57   ` Marc Dionne
2023-11-16 15:53 ` [PATCH 2/5] afs: Make error on cell lookup failure consistent with OpenAFS David Howells
2023-11-17 16:30   ` Marc Dionne
2023-11-16 15:53 ` [PATCH 3/5] afs: Return ENOENT if no cell DNS record can be found David Howells
2023-11-22 19:04   ` Marc Dionne
2023-11-16 15:53 ` [PATCH 4/5] afs: Fix file locking on R/O volumes to operate in local mode David Howells
2023-11-22 19:05   ` Marc Dionne [this message]
2023-11-16 15:53 ` [PATCH 5/5] afs: Mark a superblock for an R/O or Backup volume as SB_RDONLY David Howells
2023-11-17 15:56   ` Marc Dionne
2023-11-22 18:58 ` [PATCH 0/5] afs: Miscellaneous small fixes Jeffrey E Altman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAB9dFds4+gxWidvxWBU8PNO+wiLO0CkpudahjrymFxj5U_qXoQ@mail.gmail.com \
    --to=marc.dionne@auristor.com \
    --cc=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).