linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	wine-devel-5vRYHf7vrtgdnm+yROfE0A@public.gmane.org
Subject: [PATCH v4 7/7] locks: Disable LOCK_MAND support for MS_SHARELOCK mounts
Date: Fri,  5 Apr 2013 20:57:55 +0400	[thread overview]
Message-ID: <1365181075-22540-8-git-send-email-piastry@etersoft.ru> (raw)
In-Reply-To: <1365181075-22540-1-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>

Signed-off-by: Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
---
 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)
 		goto out;
 
+	/* Disable LOCK_MAND support for FS mounted with MS_SHARELOCK */
+	if (IS_SHARELOCK(f.file->f_path.dentry->d_inode)) {
+		error = -EPERM;
+		goto out;
+	}
+
 	can_sleep = !(cmd & LOCK_NB);
 	cmd &= ~LOCK_NB;
 	unlock = (cmd == LOCK_UN);
-- 
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-04-05 16:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05 16:57 [PATCH v4 0/7] Add O_DENY* support for VFS and CIFS/NFS Pavel Shilovsky
2013-04-05 16:57 ` [PATCH v4 2/7] CIFS: Add share_access parm to open request Pavel Shilovsky
2013-04-05 16:57 ` [PATCH v4 4/7] CIFS: Use NT_CREATE_ANDX command for forcemand mounts Pavel Shilovsky
     [not found] ` <1365181075-22540-1-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
2013-04-05 16:57   ` [PATCH v4 1/7] fcntl: Introduce new O_DENY* open flags Pavel Shilovsky
2013-04-05 16:57   ` [PATCH v4 3/7] CIFS: Add O_DENY* open flags support Pavel Shilovsky
     [not found]     ` <1365181075-22540-4-git-send-email-piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
2013-04-08 14:05       ` Jeff Layton
2013-04-08 14:25         ` Pavel Shilovsky
2013-04-05 16:57   ` [PATCH v4 5/7] NFSv4: " Pavel Shilovsky
2013-04-05 16:57   ` [PATCH v4 6/7] NFSD: Pass share reservations flags to VFS Pavel Shilovsky
2013-04-05 16:57   ` Pavel Shilovsky [this message]
2013-04-05 18:11   ` [PATCH v4 0/7] Add O_DENY* support for VFS and CIFS/NFS 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=1365181075-22540-8-git-send-email-piastry@etersoft.ru \
    --to=piastry-7qunaywfiewox3rin2dayq@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=wine-devel-5vRYHf7vrtgdnm+yROfE0A@public.gmane.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).