From: Abhijith Das Date: Mon, 1 Jun 2009 17:30:03 +0000 (-0500) Subject: GFS2: smbd proccess hangs with flock() call. X-Git-Tag: v2.6.31-rc1~390^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a12af1ebe675e85831fde3c4d0908fc3b0908b7a;p=karo-tx-linux.git GFS2: smbd proccess hangs with flock() call. 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 73b6f552f06d..841ddc979388 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);