Signed-off-by: Neil Brown Signed-off-by: Jesper Juhl -- fs/nfs/file.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/nfs/file.c b/fs/nfs/file.c index cc93865..22572af 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -428,8 +428,8 @@ static int do_vfs_lock(struct file *file BUG(); } if (res < 0) - printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n", - __FUNCTION__); + dprintk("%s: VFS is out of sync with lock manager (res = %d)!\n", + __FUNCTION__, res); return res; } @@ -479,10 +479,13 @@ static int do_setlk(struct file *filp, i * we clean up any state on the server. We therefore * record the lock call as having succeeded in order to * ensure that locks_remove_posix() cleans it out when - * the process exits. + * the process exits. Make sure not to sleep if + * someone else holds the lock. */ - if (status == -EINTR || status == -ERESTARTSYS) + if (status == -EINTR || status == -ERESTARTSYS) { + fl->fl_flags &= ~FL_SLEEP; do_vfs_lock(filp, fl); + } } else status = do_vfs_lock(filp, fl); unlock_kernel();