From: Pavel Shilovsky <piastry@etersoft.ru>
To: linux-kernel@vger.kernel.org
Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-nfs@vger.kernel.org, wine-devel@winehq.org
Subject: [PATCH v7 7/7] locks: Disable LOCK_MAND support for MS_SHARELOCK mounts
Date: Mon, 1 Jul 2013 20:49:59 +0400 [thread overview]
Message-ID: <1372697399-21361-8-git-send-email-piastry@etersoft.ru> (raw)
In-Reply-To: <1372697399-21361-1-git-send-email-piastry@etersoft.ru>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
---
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 out;
}
+ /* Disable LOCK_MAND support for FS mounted with MS_SHARELOCK */
+ if ((cmd & LOCK_MAND) && 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
prev parent reply other threads:[~2013-07-01 16:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-01 16:49 [PATCH v7 0/7] Add O_DENY* support for VFS and CIFS/NFS Pavel Shilovsky
2013-07-01 16:49 ` [PATCH v7 1/7] VFS: Introduce new O_DENY* open flags Pavel Shilovsky
2013-07-01 16:49 ` [PATCH v7 2/7] VFS: Add O_DENYDELETE support for VFS Pavel Shilovsky
2013-07-01 16:49 ` [PATCH v7 3/7] CIFS: Add share_access parm to open request Pavel Shilovsky
2013-07-01 16:49 ` [PATCH v7 4/7] CIFS: Add O_DENY* open flags support Pavel Shilovsky
2013-07-01 16:49 ` [PATCH v7 5/7] NFSv4: " Pavel Shilovsky
2013-07-01 16:49 ` [PATCH v7 6/7] NFSD: Pass share reservations flags to VFS Pavel Shilovsky
2013-07-01 16:49 ` 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=1372697399-21361-8-git-send-email-piastry@etersoft.ru \
--to=piastry@etersoft.ru \
--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=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).