Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752154AbbGWHxk (ORCPT ); Thu, 23 Jul 2015 03:53:40 -0400 Received: from nautica.notk.org ([91.121.71.147]:56142 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751325AbbGWHxa (ORCPT ); Thu, 23 Jul 2015 03:53:30 -0400 From: Dominique Martinet To: v9fs-developer@lists.sourceforge.net Cc: Eric Van Hensbergen , Ron Minnich , Latchesar Ionkov , linux-kernel@vger.kernel.org, Al Viro , "Kirill A. Shutemov" , Andrew Morton , linux-fsdevel@vger.kernel.org, Dominique Martinet Subject: [PATCH] 9p: do not overwrite return code when locking fails Date: Thu, 23 Jul 2015 09:53:27 +0200 Message-Id: <1437638007-1223-1-git-send-email-dominique.martinet@cea.fr> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 996 Lines: 31 If the remote locking fail, we run a local vfs unlock that should work We need to tell the application that tried to lock that it didn't get it, not that all went well. Signed-off-by: Dominique Martinet --- fs/9p/vfs_file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 1ef16bd..be641f1 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -231,7 +231,8 @@ out_unlock: if (res < 0 && fl->fl_type != F_UNLCK) { fl_type = fl->fl_type; fl->fl_type = F_UNLCK; - res = posix_lock_file_wait(filp, fl); + /* Even if this fails we want to return the remote error */ + posix_lock_file_wait(filp, fl); fl->fl_type = fl_type; } out: -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/