From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Whitehouse Date: Wed, 10 Jun 2009 09:31:02 +0100 Subject: [Cluster-devel] [PATCH 21/24] GFS2: smbd proccess hangs with flock() call. In-Reply-To: <1244622665-7470-21-git-send-email-swhiteho@redhat.com> References: <1244622665-7470-1-git-send-email-swhiteho@redhat.com> <1244622665-7470-2-git-send-email-swhiteho@redhat.com> <1244622665-7470-3-git-send-email-swhiteho@redhat.com> <1244622665-7470-4-git-send-email-swhiteho@redhat.com> <1244622665-7470-5-git-send-email-swhiteho@redhat.com> <1244622665-7470-6-git-send-email-swhiteho@redhat.com> <1244622665-7470-7-git-send-email-swhiteho@redhat.com> <1244622665-7470-8-git-send-email-swhiteho@redhat.com> <1244622665-7470-9-git-send-email-swhiteho@redhat.com> <1244622665-7470-10-git-send-email-swhiteho@redhat.com> <1244622665-7470-11-git-send-email-swhiteho@redhat.com> <1244622665-7470-12-git-send-email-swhiteho@redhat.com> <1244622665-7470-13-git-send-email-swhiteho@redhat.com> <1244622665-7470-14-git-send-email-swhiteho@redhat.com> <1244622665-7470-15-git-send-email-swhiteho@redhat.com> <1244622665-7470-16-git-send-email-swhiteho@redhat.com> <1244622665-7470-17-git-send-email-swhiteho@redhat.com> <1244622665-7470-18-git-send-email-swhiteho@redhat.com> <1244622665-7470-19-git-send-email-swhiteho@redhat.com> <1244622665-7470-20-git-send-email-swhiteho@redhat.com> <1244622665-7470-21-git-send-email-swhiteho@redhat.com> Message-ID: <1244622665-7470-22-git-send-email-swhiteho@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit From: Abhijith Das GFS2 currently does not support mandatory flocks. An flock() call with LOCK_MAND triggers unexpected behavior because gfs2 is not checking for this lock type. This patch corrects that. Signed-off-by: Abhi Das Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 73b6f55..841ddc9 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -698,8 +698,8 @@ static int gfs2_flock(struct file *file, int cmd, struct file_lock *fl) if (!(fl->fl_flags & FL_FLOCK)) return -ENOLCK; - if (__mandatory_lock(&ip->i_inode)) - return -ENOLCK; + if (fl->fl_type & LOCK_MAND) + return -EOPNOTSUPP; if (fl->fl_type == F_UNLCK) { do_unflock(file, fl); -- 1.6.0.6