linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Allison <jra@samba.org>
To: Andreas Dilger <adilger@sun.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Steve French <smfrench@gmail.com>,
	"linux-cifs-client@lists.samba.org"
	<linux-cifs-client@lists.samba.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: Support for applications which need NFS or CIFS "share_deny" flags on open
Date: Tue, 2 Dec 2008 15:07:03 -0800	[thread overview]
Message-ID: <20081202230703.GB11904@jeremy-desktop> (raw)
In-Reply-To: <20081202193819.GJ3186@webber.adilger.int>

On Tue, Dec 02, 2008 at 12:38:20PM -0700, Andreas Dilger wrote:
> On Dec 02, 2008  10:31 -0600, Steve French wrote:
> > Some of the Wine community posted last month to the cifs mailing list
> > asking about a change needed for Wine for working properly over
> > network mounts, but the change is not really cifs specific and would
> > help other file systems as well so I wanted to mention it here.   The
> > original post was:
> > http://marc.info/?l=linux-cifs-client&m=122505569315992&w=2
> > 
> > Support for the flags they suggest would be easy for cifs (the
> > protocol has a field for this, and cifs clients on various other OS
> > set it), and should be fairly easy for NFSv4 (the RFC for NFSv4
> > specifies the "share_deny" field within the NFS open request, and
> > various clients, but not Linux, set it), and would allow WINE to
> > function properly over a network mount.
> > 
> > >we proffer to add into the file /usr/include/asm-generic/fcntl.h
> > > following flags:
> > >
> > >#define O_DENYREAD      004000000 /* Do not permit read access */
> > >#define O_DENYWRITE     010000000 /* Do not permit write access */
> > >#define O_DENYDELETE  020000000 /* Do not permit delete or rename
> > > operations*/
> > 
> > Presumably for applications on local mounts, wine mediates their own
> > mandatory locks, but this is impossible on network mounts without this
> > change (and can lead to data corruption).
> 
> This is a disaster waiting to happen, and I would be against adding
> such functionality to Linux.  It would allow userspace applications
> to implement a denial of service to any file that they can open (e.g.
> open("/lib/libc-2.7.so", O_DENYREAD) would be really bad :-).

Indeed. If these flags are added it should only be for network
filesystem access, it would be a real mess for local access.

I guess it makes sense for them to be the inverse of the Windows
CreateFile call FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE
as by default Linux clients would use all these bits for a normal
open.

Jeremy.

      parent reply	other threads:[~2008-12-02 23:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 16:31 Support for applications which need NFS or CIFS "share_deny" flags on open Steve French
2008-12-02 19:38 ` Andreas Dilger
2008-12-02 20:06   ` Jamie Lokier
2008-12-02 20:20     ` Steve French
2008-12-02 20:21       ` Steve French
2008-12-02 21:20       ` jim owens
2008-12-02 21:26         ` Steve French
2008-12-02 23:07   ` Jeremy Allison [this message]

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=20081202230703.GB11904@jeremy-desktop \
    --to=jra@samba.org \
    --cc=adilger@sun.com \
    --cc=linux-cifs-client@lists.samba.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=smfrench@gmail.com \
    /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).