[PATCH v7 7/7] locks: Disable LOCK_MAND support for MS_SHARELOCK mounts

2013-07-01 Thread Pavel Shilovsky
Signed-off-by: Pavel Shilovsky --- fs/locks.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/fs/locks.c b/fs/locks.c index 60f3ce8..86f3a93 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1758,6 +1758,12 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) goto

[PATCH v7 6/7] NFSD: Pass share reservations flags to VFS

2013-07-01 Thread Pavel Shilovsky
that maps them into O_DENY* flags and make them visible for applications on mounts with sharelock option. Signed-off-by: Pavel Shilovsky --- fs/locks.c | 1 + fs/nfsd/nfs4state.c | 46 +- fs/nfsd/nfsproc.c | 1 + 3 files changed, 47

[PATCH v7 5/7] NFSv4: Add O_DENY* open flags support

2013-07-01 Thread Pavel Shilovsky
by passing these flags to NFSv4 open request. Make it return -ESHAREDENIED on share conflicts with other opens and disable O_DENYDELETE support since NFSv4 doesn't support it. Signed-off-by: Pavel Shilovsky --- fs/nfs/dir.c | 4 fs/nfs/internal.h | 3 ++- fs/nfs/nfs4file.c

[PATCH v7 4/7] CIFS: Add O_DENY* open flags support

2013-07-01 Thread Pavel Shilovsky
: Pavel Shilovsky --- fs/cifs/cifsfs.c | 2 +- fs/cifs/cifsglob.h | 16 +++- fs/cifs/dir.c | 4 fs/cifs/file.c | 15 +-- fs/cifs/inode.c| 5 +++-- fs/cifs/netmisc.c | 2 +- fs/cifs/smb2maperror.c | 2 +- fs/locks.c

[PATCH v7 3/7] CIFS: Add share_access parm to open request

2013-07-01 Thread Pavel Shilovsky
and simplify CIFSSMBOpen params. Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsacl.c | 8 fs/cifs/cifsglob.h | 2 +- fs/cifs/cifsproto.h | 8 fs/cifs/cifssmb.c | 50 +++--- fs/cifs/dir.c | 12 ++-- fs/cifs

[PATCH v7 2/7] VFS: Add O_DENYDELETE support for VFS

2013-07-01 Thread Pavel Shilovsky
Introduce new LOCK_DELETE flock flag that is suggested to be used internally only to map O_DENYDELETE open flag: !O_DENYDELETE -> LOCK_DELETE | LOCK_MAND. Signed-off-by: Pavel Shilovsky --- fs/locks.c | 55 +--- fs/name

[PATCH v7 1/7] VFS: Introduce new O_DENY* open flags

2013-07-01 Thread Pavel Shilovsky
es on newly created files: when open with O_CREAT can return -ESHAREDENIED error for successfully created files due to a sharelock set by another task. Temporary disable O_DENYDELETE support - will enable it in further patches. Signed-off-by: Pavel Shilovsky --- arch/alpha/include/uapi/asm/err

[PATCH v7 0/7] Add O_DENY* support for VFS and CIFS/NFS

2013-07-01 Thread Pavel Shilovsky
done through flocks. If O_DENY* flags are specified, flock syscall is processed after the open. The share modes are translated into flock according the following rules: 1) !O_DENYREAD -> LOCK_READ | LOCK_MAND 2) !O_DENYWRITE -> LOCK_WRITE | LOCK_MAND 3) !O_DENYDELETE -> LOCK_DELETE | LOCK_MA

Re: [PATCH v6 2/7] VFS: Add O_DENYDELETE support for VFS

2013-06-11 Thread Pavel Shilovsky
2013/6/11 Jeff Layton : > On Fri, 26 Apr 2013 16:04:16 +0400 > Pavel Shilovsky wrote: > >> Introduce new LOCK_DELETE flock flag that is suggested to be used >> internally only to map O_DENYDELETE open flag: >> >> !O_DENYDELETE -> LOCK_DELETE | LOCK_MAND.

Re: [PATCH v6 2/7] VFS: Add O_DENYDELETE support for VFS

2013-05-13 Thread Pavel Shilovsky
2013/5/10 Jeff Layton : > On Fri, 26 Apr 2013 16:04:16 +0400 > Pavel Shilovsky wrote: > >> Introduce new LOCK_DELETE flock flag that is suggested to be used >> internally only to map O_DENYDELETE open flag: >> >> !O_DENYDELETE -> LOCK_DELETE | LOCK_MAND.

[PATCH v6 7/7] locks: Disable LOCK_MAND support for MS_SHARELOCK mounts

2013-04-26 Thread Pavel Shilovsky
Signed-off-by: Pavel Shilovsky --- fs/locks.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/fs/locks.c b/fs/locks.c index 25c3a49..7d67e0e 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1756,6 +1756,12 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) goto

[PATCH v6 4/7] CIFS: Add O_DENY* open flags support

2013-04-26 Thread Pavel Shilovsky
: Pavel Shilovsky --- fs/cifs/cifsfs.c | 2 +- fs/cifs/cifsglob.h | 16 +++- fs/cifs/dir.c | 4 fs/cifs/file.c | 15 +-- fs/cifs/inode.c| 5 +++-- fs/cifs/netmisc.c | 2 +- fs/cifs/smb2maperror.c | 2 +- fs/locks.c

[PATCH v6 0/7] Add O_DENY* support for VFS and CIFS/NFS

2013-04-26 Thread Pavel Shilovsky
k syscall is processed after the open. The share modes are translated into flock according the following rules: 1) !O_DENYREAD -> LOCK_READ | LOCK_MAND 2) !O_DENYWRITE -> LOCK_WRITE | LOCK_MAND 3) !O_DENYDELETE -> LOCK_DELETE | LOCK_MAND - Pavel Shilovsky (7): VFS: Introduc

[PATCH v6 6/7] NFSD: Pass share reservations flags to VFS

2013-04-26 Thread Pavel Shilovsky
that maps them into O_DENY* flags and make them visible for applications on mounts with sharelock option. Signed-off-by: Pavel Shilovsky --- fs/locks.c | 1 + fs/nfsd/nfs4state.c | 46 +- fs/nfsd/nfsproc.c | 1 + 3 files changed, 47

[PATCH v6 5/7] NFSv4: Add O_DENY* open flags support

2013-04-26 Thread Pavel Shilovsky
by passing these flags to NFSv4 open request. Make it return -ESHAREDENIED on share conflicts with other opens and disable O_DENYDELETE support since NFSv4 doesn't support it. Signed-off-by: Pavel Shilovsky --- fs/nfs/dir.c | 4 fs/nfs/internal.h | 3 ++- fs/nfs/nfs4file.c

[PATCH v6 3/7] CIFS: Add share_access parm to open request

2013-04-26 Thread Pavel Shilovsky
and simplify CIFSSMBOpen params. Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsacl.c | 8 fs/cifs/cifsglob.h | 2 +- fs/cifs/cifsproto.h | 8 fs/cifs/cifssmb.c | 50 +++--- fs/cifs/dir.c | 12 ++-- fs/cifs

[PATCH v6 2/7] VFS: Add O_DENYDELETE support for VFS

2013-04-26 Thread Pavel Shilovsky
Introduce new LOCK_DELETE flock flag that is suggested to be used internally only to map O_DENYDELETE open flag: !O_DENYDELETE -> LOCK_DELETE | LOCK_MAND. Signed-off-by: Pavel Shilovsky --- fs/locks.c | 53 +--- fs/name

[PATCH v6 1/7] VFS: Introduce new O_DENY* open flags

2013-04-26 Thread Pavel Shilovsky
s on newely created files: when open with O_CREAT can return -ESHAREDENIED error for successfully created files due to a sharelock set by another task. Temporary disable O_DENYDELETE support - will enable it in further patches. Signed-off-by: Pavel Shilovsky --- fs/fcntl.c

Re: [PATCH v5 4/7] CIFS: Use NT_CREATE_ANDX command for forcemand mounts

2013-04-10 Thread Pavel Shilovsky
/* use NT_CREATE_ANDX */ else /* use TRANS2 OPEN */ -- Best regards, Pavel Shilovsky.

Re: [PATCH v5 1/7] fcntl: Introduce new O_DENY* open flags

2013-04-10 Thread Pavel Shilovsky
2013/4/10 Jeff Layton : > On Tue, 9 Apr 2013 16:40:21 +0400 > Pavel Shilovsky 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 doe

Re: [PATCH v5 4/7] CIFS: Use NT_CREATE_ANDX command for forcemand mounts

2013-04-10 Thread Pavel Shilovsky
2013/4/10 Jeff Layton : > On Tue, 9 Apr 2013 16:40:24 +0400 > Pavel Shilovsky wrote: > >> forcemand mount option now lets us use Windows mandatory style of >> byte-range locks even if server supports posix ones - switches on >> Windows locking mechanism. Share flags

[PATCH v5 6/7] NFSD: Pass share reservations flags to VFS

2013-04-09 Thread Pavel Shilovsky
that maps them into O_DENY flags and make them visible for applications that use O_DENYMAND opens. Signed-off-by: Pavel Shilovsky --- fs/locks.c | 1 + fs/nfsd/nfs4state.c | 46 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git

[PATCH v5 7/7] locks: Disable LOCK_MAND support for MS_SHARELOCK mounts

2013-04-09 Thread Pavel Shilovsky
Signed-off-by: Pavel Shilovsky --- fs/locks.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/fs/locks.c b/fs/locks.c index 1402a43..a67857c 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1719,6 +1719,12 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) if (!f.file

[PATCH v5 5/7] NFSv4: Add O_DENY* open flags support

2013-04-09 Thread Pavel Shilovsky
by passing these flags to NFSv4 open request. Also make it return -EBUSY on share conflicts with other opens. Signed-off-by: Pavel Shilovsky --- fs/nfs/internal.h | 3 ++- fs/nfs/nfs4proc.c | 4 +++- fs/nfs/nfs4super.c | 9 ++--- fs/nfs/nfs4xdr.c | 21 + fs/nfs

[PATCH v5 4/7] CIFS: Use NT_CREATE_ANDX command for forcemand mounts

2013-04-09 Thread Pavel Shilovsky
Windows locking mechanism in one mount option by using NT_CREATE_ANDX to open files if forcemand is on. Signed-off-by: Pavel Shilovsky --- fs/cifs/dir.c | 1 + fs/cifs/file.c | 6 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index d4331de

[PATCH v5 3/7] CIFS: Add O_DENY* open flags support

2013-04-09 Thread Pavel Shilovsky
Construct share_access value from O_DENY* flags and send it to the server. Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsfs.c | 2 +- fs/cifs/cifsglob.h | 16 +++- fs/cifs/dir.c | 3 +++ fs/cifs/file.c | 4 fs/locks.c | 7 ++- include/linux/fs.h | 1

[PATCH v5 2/7] CIFS: Add share_access parm to open request

2013-04-09 Thread Pavel Shilovsky
and simplify CIFSSMBOpen params. Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsacl.c | 8 fs/cifs/cifsglob.h | 2 +- fs/cifs/cifsproto.h | 8 fs/cifs/cifssmb.c | 50 +++--- fs/cifs/dir.c | 12 ++-- fs/cifs

[PATCH v5 1/7] fcntl: Introduce new O_DENY* open flags

2013-04-09 Thread Pavel Shilovsky
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. Signed-off-by: Pavel Shilovsky --- fs/fcntl.c | 5 ++- fs/locks.c | 93 +++

[PATCH v5 0/7] Add O_DENY* support for VFS and CIFS/NFS

2013-04-09 Thread Pavel Shilovsky
rules: 1) !O_DENYREAD -> LOCK_READ | LOCK_MAND 2) !O_DENYWRITE -> LOCK_WRITE | LOCK_MAND - Pavel Shilovsky (7): fcntl: Introduce new O_DENY* open flags CIFS: Add share_access parm to open request CIFS: Add O_DENY* open flags support CIFS: Use NT_CREATE_ANDX command for forcemand mount

Re: [PATCH v4 3/7] CIFS: Add O_DENY* open flags support

2013-04-08 Thread Pavel Shilovsky
2013/4/8 Jeff Layton : > On Fri, 5 Apr 2013 20:57:51 +0400 > Pavel Shilovsky wrote: > >> Construct share_access value from O_DENY* flags and send it to >> the server. >> >> Signed-off-by: Pavel Shilovsky >> --- >> fs/cifs/cifsglob.h | 16 ++

Re: [PATCH v4 0/7] Add O_DENY* support for VFS and CIFS/NFS

2013-04-05 Thread Pavel Shilovsky
2013/4/5 Pavel Shilovsky : > Main changes from the previous one: > 1) O_DENYMAND is removed, sharelock mount option is introduced. > 2) Patch fcntl.h and VFS patches are united into one. > 3) flock/LOCK_MAND is disabled for sharelock mounts. > > This patchset adds support of

[PATCH v4 1/7] fcntl: Introduce new O_DENY* open flags

2013-04-05 Thread Pavel Shilovsky
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. Signed-off-by: Pavel Shilovsky --- fs/fcntl.c | 5 ++- fs/locks.c | 93 +++

[PATCH v4 7/7] locks: Disable LOCK_MAND support for MS_SHARELOCK mounts

2013-04-05 Thread Pavel Shilovsky
Signed-off-by: Pavel Shilovsky --- fs/locks.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/fs/locks.c b/fs/locks.c index ea5813c..8a59afb 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -1722,6 +1722,12 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) if (!f.file

[PATCH v4 6/7] NFSD: Pass share reservations flags to VFS

2013-04-05 Thread Pavel Shilovsky
that maps them into O_DENY flags and make them visible for applications that use O_DENYMAND opens. Signed-off-by: Pavel Shilovsky --- fs/locks.c | 1 + fs/nfsd/nfs4state.c | 46 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git

[PATCH v4 5/7] NFSv4: Add O_DENY* open flags support

2013-04-05 Thread Pavel Shilovsky
by passing these flags to NFSv4 open request. Signed-off-by: Pavel Shilovsky --- fs/locks.c| 6 +++--- fs/nfs/internal.h | 3 ++- fs/nfs/nfs4proc.c | 2 ++ fs/nfs/nfs4xdr.c | 21 + fs/nfs/super.c| 3 ++- 5 files changed, 26 insertions(+), 9 deletions

[PATCH v4 3/7] CIFS: Add O_DENY* open flags support

2013-04-05 Thread Pavel Shilovsky
Construct share_access value from O_DENY* flags and send it to the server. Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsglob.h | 16 +++- fs/cifs/dir.c | 3 +++ fs/cifs/file.c | 4 fs/locks.c | 8 4 files changed, 30 insertions(+), 1 deletion

[PATCH v4 4/7] CIFS: Use NT_CREATE_ANDX command for forcemand mounts

2013-04-05 Thread Pavel Shilovsky
Windows locking mechanism in one mount option by using NT_CREATE_ANDX to open files if forcemand is on. Signed-off-by: Pavel Shilovsky --- fs/cifs/dir.c | 1 + fs/cifs/file.c | 6 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index d4331de

[PATCH v4 2/7] CIFS: Add share_access parm to open request

2013-04-05 Thread Pavel Shilovsky
and simplify CIFSSMBOpen params. Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsacl.c | 8 fs/cifs/cifsglob.h | 2 +- fs/cifs/cifsproto.h | 8 fs/cifs/cifssmb.c | 50 +++--- fs/cifs/dir.c | 12 ++-- fs/cifs

[PATCH v4 0/7] Add O_DENY* support for VFS and CIFS/NFS

2013-04-05 Thread Pavel Shilovsky
is mechanism is done through flocks. If O_DENY* flags are specified, flock syscall is processed after the open. The share modes are translated into flock according the following rules: 1) !O_DENYREAD -> LOCK_READ | LOCK_MAND 2) !O_DENYWRITE -> LOCK_WRITE | LOCK_MAND - Pavel Shilovsky

Re: [PATCH v3 6/7] NFSv4: Add O_DENY* open flags support

2013-04-04 Thread Pavel Shilovsky
later. > > Also, suppose there are changes in the future that require you to > determine this before calling into ->open? Then you'll have to go back > and somehow mark the fs anyway... Ok, this makes sense, thanks. Will do it this way and repost. -- Best regards, Pavel Shilovsky.

Re: [PATCH v3 6/7] NFSv4: Add O_DENY* open flags support

2013-04-04 Thread Pavel Shilovsky
2013/3/12 Jeff Layton : > On Mon, 11 Mar 2013 14:54:34 -0400 > Jeff Layton wrote: > >> On Thu, 28 Feb 2013 19:25:32 +0400 >> Pavel Shilovsky wrote: >> >> > by passing these flags to NFSv4 open request. >> > >> > Signed-off-by:

Re: [PATCH v3 5/7] CIFS: Translate SHARING_VIOLATION to -ETXTBSY error code for SMB2

2013-03-11 Thread Pavel Shilovsky
2013/3/11 Jeff Layton : > On Thu, 28 Feb 2013 19:25:31 +0400 > Pavel Shilovsky wrote: > >> to make it match CIFS and VFS variants. >> >> Signed-off-by: Pavel Shilovsky >> --- >> fs/cifs/smb2maperror.c | 2 +- >> 1 file changed, 1 insertion

Re: [PATCH v3 2/7] vfs: Add O_DENYREAD/WRITE flags support for open syscall

2013-03-11 Thread Pavel Shilovsky
2013/3/11 Jeff Layton : > On Thu, 28 Feb 2013 19:25:28 +0400 > Pavel Shilovsky wrote: > >> If O_DENYMAND flag is specified, O_DENYREAD/WRITE/MAND flags are >> translated to flock's flags: >> >> !O_DENYREAD -> LOCK_READ >> !O_DENYWRITE -> LOC

Re: [PATCH v3 0/7] Add O_DENY* support for VFS and CIFS/NFS

2013-03-11 Thread Pavel Shilovsky
share locks. I doubt anyone sane actually uses >> mandatory fcntl locks, but still I suppose it would probably be better >> to play it safe and use a new mount option. > > > Maybe we should have a -o win_semantics option :-) > > /me runs > (CC'ing Al Viro, since these patches should go through his tree) I don't mind to introduce a new mount option for turning this feature on/off - something like '-o denylock' to make it mathing names of new flags would be ok. Al, what do you think about this feature overall? -- Best regards, Pavel Shilovsky.

Re: [PATCH v3 0/7] Add O_DENY* support for VFS and CIFS/NFS

2013-02-28 Thread Pavel Shilovsky
2013/3/1 Andy Lutomirski : > [possible resend -- sorry] > > On 02/28/2013 07:25 AM, Pavel Shilovsky wrote: >> This patchset adds support of O_DENY* flags for Linux fs layer. These flags >> can be used by any application that needs share reservations to organize a >> f

[PATCH v3 7/7] NFSD: Pass share reservations flags to VFS

2013-02-28 Thread Pavel Shilovsky
that maps them into O_DENY flags and make them visible for applications that use O_DENYMAND opens. Signed-off-by: Pavel Shilovsky --- fs/locks.c | 1 + fs/nfsd/nfs4state.c | 46 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git

[PATCH v3 6/7] NFSv4: Add O_DENY* open flags support

2013-02-28 Thread Pavel Shilovsky
by passing these flags to NFSv4 open request. Signed-off-by: Pavel Shilovsky --- fs/nfs/nfs4xdr.c | 24 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 26b1439..58ddc74 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs

[PATCH v3 5/7] CIFS: Translate SHARING_VIOLATION to -ETXTBSY error code for SMB2

2013-02-28 Thread Pavel Shilovsky
to make it match CIFS and VFS variants. Signed-off-by: Pavel Shilovsky --- fs/cifs/smb2maperror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c index 494c912..11e589e 100644 --- a/fs/cifs/smb2maperror.c +++ b/fs/cifs

[PATCH v3 4/7] CIFS: Use NT_CREATE_ANDX command for forcemand mounts

2013-02-28 Thread Pavel Shilovsky
Windows locking mechanism in one mount option by using NT_CREATE_ANDX to open files if forcemand is on. Signed-off-by: Pavel Shilovsky --- fs/cifs/dir.c | 1 + fs/cifs/file.c | 6 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 6975072

[PATCH v3 3/7] CIFS: Add O_DENY* open flags support

2013-02-28 Thread Pavel Shilovsky
Make CIFSSMBOpen take share_flags as a parm that allows us to pass new O_DENY* flags to the server. Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsacl.c | 6 -- fs/cifs/cifsglob.h | 12 +++- fs/cifs/cifsproto.h | 9 + fs/cifs/cifssmb.c | 47

[PATCH v3 2/7] vfs: Add O_DENYREAD/WRITE flags support for open syscall

2013-02-28 Thread Pavel Shilovsky
ged to prevent data races on newely created files: when open with O_CREAT can return with -ETXTBSY error for successfully created files due to a deny lock set by another task. Signed-off-by: Pavel Shilovsky --- fs/locks.c | 116 +++-- fs/na

[PATCH v3 1/7] fcntl: Introduce new O_DENY* open flags

2013-02-28 Thread Pavel Shilovsky
ch flags - this change can benefit cifs and nfs modules as well as Samba and NFS file servers. These flags are only take affect for opens with O_DENYMAND flags - there is no impact on native Linux opens. Signed-off-by: Pavel Shilovsky --- fs/fcntl.c | 5 +++-- include/u

[PATCH v3 0/7] Add O_DENY* support for VFS and CIFS/NFS

2013-02-28 Thread Pavel Shilovsky
e following rules: 1) O_DENYMAND -> LOCK_MAND 2) !O_DENYREAD -> LOCK_READ 3) !O_DENYWRITE -> LOCK_WRITE - Pavel Shilovsky (7): fcntl: Introduce new O_DENY* open flags vfs: Add O_DENYREAD/WRITE flags support for open syscall CIFS: Add O_DENY* open flags support CIFS: U

Re: [PATCH v2 3/8] vfs: Add O_DENYREAD/WRITE flags support for open syscall

2013-02-07 Thread Pavel Shilovsky
ast we go to 'opened' lable. Then we have a 3(!) chances to return -1 while a file is created (open_check_o_direct, ima_file_check, handle_truncate). In this case these places are bugs too. We can call vfs_unlink if we failed after a file was created, but possible affects need to be investigated. -- Best regards, Pavel Shilovsky.

Re: [PATCH v2 3/8] vfs: Add O_DENYREAD/WRITE flags support for open syscall

2013-02-07 Thread Pavel Shilovsky
2013/2/7 J. Bruce Fields : > On Thu, Feb 07, 2013 at 06:32:38PM +0400, Pavel Shilovsky wrote: >> 2013/2/7 J. Bruce Fields : >> > On Thu, Feb 07, 2013 at 01:53:46PM +0400, Pavel Shilovsky wrote: >> >> Nothing prevents it. If somebody grabbed a share mode lock

Re: [PATCH v2 3/8] vfs: Add O_DENYREAD/WRITE flags support for open syscall

2013-02-07 Thread Pavel Shilovsky
2013/2/7 J. Bruce Fields : > On Thu, Feb 07, 2013 at 01:53:46PM +0400, Pavel Shilovsky wrote: >> Nothing prevents it. If somebody grabbed a share mode lock on a file >> before we call deny_lock_file, we simply close this file and return >> -ETXTBSY. > > But leave the ne

Re: [PATCH v2 3/8] vfs: Add O_DENYREAD/WRITE flags support for open syscall

2013-02-07 Thread Pavel Shilovsky
2013/2/5 J. Bruce Fields : > On Tue, Feb 05, 2013 at 03:45:31PM +0400, Pavel Shilovsky wrote: >> 2013/1/31 J. Bruce Fields : >> > On Thu, Jan 17, 2013 at 08:52:59PM +0400, Pavel Shilovsky wrote: >> >> If O_DENYMAND flag is specified, O_DENYREAD/WRITE/MAND flags a

Re: [PATCH v2 0/8] Add O_DENY* support for VFS and CIFS/NFS

2013-02-07 Thread Pavel Shilovsky
2013/2/5 J. Bruce Fields : > On Tue, Feb 05, 2013 at 03:33:21PM +0400, Pavel Shilovsky wrote: >> 2013/1/31 J. Bruce Fields : >> > On Thu, Jan 17, 2013 at 08:52:09PM +0400, Pavel Shilovsky wrote: >> >> This patchset adds support of O_DENY* flags for Linux fs layer. The

Re: [PATCH v2 4/8] CIFS: Add O_DENY* open flags support

2013-02-05 Thread Pavel Shilovsky
2013/1/31 J. Bruce Fields : > On Thu, Jan 17, 2013 at 08:53:00PM +0400, Pavel Shilovsky wrote: >> Make CIFSSMBOpen take share_flags as a parm that allows us >> to pass new O_DENY* flags to the server. >> >> Signed-off-by: Pavel Shilovsky >> --- >> fs/cifs/

Re: [PATCH v2 3/8] vfs: Add O_DENYREAD/WRITE flags support for open syscall

2013-02-05 Thread Pavel Shilovsky
2013/1/31 J. Bruce Fields : > On Thu, Jan 17, 2013 at 08:52:59PM +0400, Pavel Shilovsky wrote: >> If O_DENYMAND flag is specified, O_DENYREAD/WRITE/MAND flags are >> translated to flock's flags: >> >> !O_DENYREAD -> LOCK_READ >> !O_DENYWRITE -> LOCK_

Re: [PATCH v2 0/8] Add O_DENY* support for VFS and CIFS/NFS

2013-02-05 Thread Pavel Shilovsky
2013/1/31 J. Bruce Fields : > On Thu, Jan 17, 2013 at 08:52:09PM +0400, Pavel Shilovsky wrote: >> This patchset adds support of O_DENY* flags for Linux fs layer. These flags >> can be used by any application that needs share reservations to organize a >> file access. VFS alr

Re: [PATCH v2 0/8] Add O_DENY* support for VFS and CIFS/NFS

2013-01-17 Thread Pavel Shilovsky
2013/1/18 Stephen Rothwell : > Hi Pavel, > > On Thu, 17 Jan 2013 20:52:09 +0400 Pavel Shilovsky > wrote: >> >> This patchset adds support of O_DENY* flags for Linux fs layer. These flags >> can be used by any application that needs share reservations to organize

[PATCH v2 6/8] CIFS: Translate SHARING_VIOLATION to -ETXTBSY error code for SMB2

2013-01-17 Thread Pavel Shilovsky
to make it match CIFS and VFS variants. Signed-off-by: Pavel Shilovsky --- fs/cifs/smb2maperror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c index 494c912..11e589e 100644 --- a/fs/cifs/smb2maperror.c +++ b/fs/cifs

[PATCH v2 7/8] NFSv4: Add O_DENY* open flags support

2013-01-17 Thread Pavel Shilovsky
by passing these flags to NFSv4 open request. Signed-off-by: Pavel Shilovsky --- fs/nfs/nfs4xdr.c | 24 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 40836ee..0a0cd1e 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs

[PATCH v2 8/8] NFSD: Pass share reservations flags to VFS

2013-01-17 Thread Pavel Shilovsky
that maps them into O_DENY flags and make them visible for applications that use O_DENYMAND opens. Signed-off-by: Pavel Shilovsky --- fs/locks.c | 1 + fs/nfsd/nfs4state.c | 46 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git

[PATCH v2 5/8] CIFS: Use NT_CREATE_ANDX command for forcemand mounts

2013-01-17 Thread Pavel Shilovsky
Windows locking mechanism in one mount option by using NT_CREATE_ANDX to open files if forcemand is on. Signed-off-by: Pavel Shilovsky --- fs/cifs/dir.c | 1 + fs/cifs/file.c | 6 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 12ee773

[PATCH v2 4/8] CIFS: Add O_DENY* open flags support

2013-01-17 Thread Pavel Shilovsky
Make CIFSSMBOpen take share_flags as a parm that allows us to pass new O_DENY* flags to the server. Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsacl.c | 10 ++ fs/cifs/cifsglob.h | 12 +++- fs/cifs/cifsproto.h | 9 + fs/cifs/cifssmb.c | 47

[PATCH v2 3/8] vfs: Add O_DENYREAD/WRITE flags support for open syscall

2013-01-17 Thread Pavel Shilovsky
l other native Linux opens don't care about these flags. It allow us to enable this feature for applications that need it (e.g. NFS and Samba servers that export the same directory for Windows clients, or Wine applications that access the same files simultaneously). Signed-off-by: Pavel Shilovs

[PATCH v2 2/8] fcntl: Introduce new O_DENY* open flags

2013-01-17 Thread Pavel Shilovsky
ch flags - this change can benefit cifs and nfs modules as well as Samba and NFS file servers. These flags are only take affect for opens with O_DENYMAND flags - there is no impact on native Linux opens. Signed-off-by: Pavel Shilovsky --- fs/fcntl.c | 5 +++-- include/u

[PATCH v2 1/8] locks: make flock_lock_file take is_conflict callback parm

2013-01-17 Thread Pavel Shilovsky
This parm demetermines how to check if locks have conflicts. This let us use flock_lock_file funtions further to add O_DENY* flags support through flocks. Signed-off-by: Pavel Shilovsky --- fs/locks.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fs/locks.c

[PATCH v2 0/8] Add O_DENY* support for VFS and CIFS/NFS

2013-01-17 Thread Pavel Shilovsky
a.git;a=commitdiff;h=f116c478bf9a1bc3985e9a719fb20d854914d67a Pavel Shilovsky (8): locks: make flock_lock_file take is_conflict callback parm fcntl: Introduce new O_DENY* open flags vfs: Add O_DENYREAD/WRITE flags support for open syscall CIFS: Add O_DENY* open flags support CIFS: Use NT_CRE

Re: [PATCH 0/3] Add O_DENY* flags to fcntl and cifs

2012-12-14 Thread Pavel Shilovsky
2012/12/12 David Laight : > On Sat, Dec 08, 2012 at 12:43:14AM +0400, Pavel Shilovsky wrote: >> >> The problem is the possibility of denial-of-service attacks here. We >> can try to prevent them by: > > FWIW I already see a DoS 'attack'. > I have some

Re: [PATCH 0/3] Add O_DENY* flags to fcntl and cifs

2012-12-10 Thread Pavel Shilovsky
Christoph Hellwig писал 07.12.2012 20:16: On Thu, Dec 06, 2012 at 10:26:28PM +0400, Pavel Shilovsky wrote: Network filesystems CIFS, SMB2.0, SMB3.0 and NFSv4 have such flags - this change can benefit cifs and nfs modules. While this change is ok for network filesystems, itsn't not targete

Re: [PATCH 0/3] Add O_DENY* flags to fcntl and cifs

2012-12-07 Thread Pavel Shilovsky
2012/12/6 Pavel Shilovsky : > Network filesystems CIFS, SMB2.0, SMB3.0 and NFSv4 have such flags - this > change can benefit cifs and nfs modules. While this change is ok for network > filesystems, itsn't not targeted for local filesystems due security problems > (e.g. when a

[PATCH 1/3] fcntl: Introduce new O_DENY* open flags for network filesystems

2012-12-06 Thread Pavel Shilovsky
les. While this change is ok for network filesystems, itsn't not targeted for local filesystems due to security problems (e.g. when a user process can deny root to delete a file). Signed-off-by: Pavel Shilovsky --- fs/fcntl.c |5 +++-- include/uapi/asm-ge

[PATCH 3/3] CIFS: Use NT_CREATE_ANDX command for forcemand mounts

2012-12-06 Thread Pavel Shilovsky
Windows locking mechanism in one mount option by using NT_CREATE_ANDX to open files if forcemand is on. Signed-off-by: Pavel Shilovsky --- fs/cifs/dir.c |1 + fs/cifs/file.c |6 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index

[PATCH 2/3] CIFS: Add O_DENY* open flags support

2012-12-06 Thread Pavel Shilovsky
Make CIFSSMBOpen take share_flags as a parm that allows us to pass new O_DENY* flags to the server. Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsacl.c | 10 ++ fs/cifs/cifsglob.h | 11 ++- fs/cifs/cifsproto.h |9 + fs/cifs/cifssmb.c | 47

[PATCH 0/3] Add O_DENY* flags to fcntl and cifs

2012-12-06 Thread Pavel Shilovsky
Share flags are used by Windows applications and WINE have to deal with them too. While WINE can process open share flags itself on local filesystems, it can't do it if a file stored on a network share and is used by several clients. This patchset makes it possible for CIFS/SMB2.0/SMB3

Re: [PATCH 0/3] Add O_DENY* flags to fcntl and cifs

2012-12-01 Thread Pavel Shilovsky
2012/11/30 Pavel Shilovsky : > Network filesystems CIFS, SMB2.0, SMB3.0 and NFSv4 have such flags - this > change can benefit cifs and nfs modules. While this change is ok for network > filesystems, itsn't not targeted for local filesystems due security problems > (e.g. when a