lkml.org 
[lkml]   [2013]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v7 7/7] locks: Disable LOCK_MAND support for MS_SHARELOCK mounts
Date
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


\
 
 \ /
  Last update: 2013-07-01 19:21    [W:0.694 / U:1.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site