From: Frank Filz <ffilzlnx@us.ibm.com>
To: Pavel Shilovsky <piastry@etersoft.ru>
Cc: Jeff Layton <jlayton@poochiereds.net>,
linux-kernel@vger.kernel.org,
linux-cifs <linux-cifs@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Linux NFS Mailing list <linux-nfs@vger.kernel.org>,
wine-devel@winehq.org
Subject: Re: [PATCH v5 1/7] fcntl: Introduce new O_DENY* open flags
Date: Wed, 10 Apr 2013 09:27:27 -0700 [thread overview]
Message-ID: <516592EF.2080707@us.ibm.com> (raw)
In-Reply-To: <CAKywueRw7Oqa_z7yFo9CuoPXxJ3xPmCY0zcJwfxBKqBHNC+4zg@mail.gmail.com>
linux-nfs-owner@vger.kernel.org wrote on 04/10/2013 06:24:39 AM:
> 2013/4/10 Jeff Layton <jlayton@poochiereds.net>:
> > On Tue, 9 Apr 2013 16:40:21 +0400
> > Pavel Shilovsky <piastry@etersoft.ru> wrote:
> >
> >> This patch adds 3 flags:
> >> 1) O_DENYREAD that doesn't permit read access,
> >> 2) O_DENYWRITE that doesn't permit write access,
> >> 3) O_DENYDELETE that doesn't permit delete or rename,
> >>
> >> Network filesystems CIFS, SMB2.0, SMB3.0 and NFSv4 have such flags -
> >> this change can benefit cifs and nfs modules as well as Samba and
> >> NFS file servers that export the same directory for Windows clients,
> >> or Wine applications that access the same files simultaneously.
> >>
> >> These flags are only take affect for opens on mounts with 'sharelock'
> >> mount option. They are translated to flock's flags:
> >>
> >> !O_DENYREAD -> LOCK_READ | LOCK_MAND
> >> !O_DENYWRITE -> LOCK_WRITE | LOCK_MAND
> >>
> >> and set through flock_lock_file on a file. If the file can't be locked
> >> due conflicts with another open with O_DENY* flags, the -EBUSY error
> >> code is returned.
> >>
> >> Create codepath is slightly changed to prevent data races on
> >> newely created files: when open with O_CREAT can return with -EBUSY
> >> error for successfully created files due to a deny lock set by
> >> another task.
> >>
> >
> > It's good that this is consistent with the new patchset. I'm still not
> > 100% sure that -EBUSY is the right error return here, but it should at
> > least help distinguish between "mode bits don't allow me to open" and
> > "file has share reservation set".
> >
> > Heck, since we're departing from POSIX here, maybe we should consider a
> > new error code altogether? ESHAREDENIED or something?
>
> That can make sense. I don't mind to change this part.
I like this return code, it will help user space file servers return the
correct error to their clients when they depend on the kernel to resolve
share reservations. Internal to the kernel, having ESHAREDENIED will
also be helpful to the NFS v4 and NLM code.
Frank
next prev parent reply other threads:[~2013-04-10 16:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-09 12:40 [PATCH v5 0/7] Add O_DENY* support for VFS and CIFS/NFS Pavel Shilovsky
2013-04-09 12:40 ` [PATCH v5 1/7] fcntl: Introduce new O_DENY* open flags Pavel Shilovsky
[not found] ` <1365511227-17626-2-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
2013-04-10 11:18 ` Jeff Layton
[not found] ` <20130410071824.5a37cbaf-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2013-04-10 13:24 ` Pavel Shilovsky
2013-04-10 16:27 ` Frank Filz [this message]
2013-04-09 12:40 ` [PATCH v5 2/7] CIFS: Add share_access parm to open request Pavel Shilovsky
2013-04-09 12:40 ` [PATCH v5 3/7] CIFS: Add O_DENY* open flags support Pavel Shilovsky
2013-04-09 12:40 ` [PATCH v5 4/7] CIFS: Use NT_CREATE_ANDX command for forcemand mounts Pavel Shilovsky
[not found] ` <1365511227-17626-5-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
2013-04-10 11:11 ` Jeff Layton
[not found] ` <20130410071144.08ef2983-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2013-04-10 11:45 ` Pavel Shilovsky
2013-04-10 12:12 ` Jeff Layton
2013-04-10 13:59 ` Pavel Shilovsky
2013-04-09 12:40 ` [PATCH v5 5/7] NFSv4: Add O_DENY* open flags support Pavel Shilovsky
2013-04-09 12:40 ` [PATCH v5 6/7] NFSD: Pass share reservations flags to VFS Pavel Shilovsky
[not found] ` <1365511227-17626-1-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
2013-04-09 12:40 ` [PATCH v5 7/7] locks: Disable LOCK_MAND support for MS_SHARELOCK mounts Pavel Shilovsky
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=516592EF.2080707@us.ibm.com \
--to=ffilzlnx@us.ibm.com \
--cc=jlayton@poochiereds.net \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=piastry@etersoft.ru \
--cc=wine-devel@winehq.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).