lkml.org 
[lkml]   [2009]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 21/24] GFS2: smbd proccess hangs with flock() call.
    Date
    From: Abhijith Das <adas@redhat.com>

    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 <adas@redhat.com>
    Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

    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


    \
     
     \ /
      Last update: 2009-06-10 11:51    [W:4.241 / U:0.288 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site