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 v5 7/7] locks: Disable LOCK_MAND support for MS_SHARELOCK mounts
Date: Tue,  9 Apr 2013 16:40:27 +0400	[thread overview]
Message-ID: <1365511227-17626-8-git-send-email-piastry@etersoft.ru> (raw)
In-Reply-To: <1365511227-17626-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 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)
 		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-09 12:40 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
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   ` Pavel Shilovsky [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=1365511227-17626-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).