From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Layton Subject: [PATCH] locks: fix fcntl_setlease/getlease return when !CONFIG_FILE_LOCKING Date: Wed, 24 Sep 2014 09:23:13 -0400 Message-ID: <1411564993-26041-1-git-send-email-jlayton@primarydata.com> Cc: hch@infradead.org, bfields@fieldses.org To: linux-fsdevel@vger.kernel.org Return-path: Received: from mail-qa0-f49.google.com ([209.85.216.49]:42415 "EHLO mail-qa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750974AbaIXNXV (ORCPT ); Wed, 24 Sep 2014 09:23:21 -0400 Received: by mail-qa0-f49.google.com with SMTP id n8so3069875qaq.22 for ; Wed, 24 Sep 2014 06:23:20 -0700 (PDT) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Currently they both just return 0. Fix them to return more appropriate values instead. For better or worse, most places in the kernel return -EINVAL when leases aren't available. ENOLCK would probably have been better, but let's follow suit here in the case of F_SETLEASE. In the F_GETLEASE case, just return F_UNLCK since we know that no lease will have been set. Signed-off-by: Jeff Layton --- include/linux/fs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index bb9484ae1eef..2023306c620e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1008,12 +1008,12 @@ static inline int fcntl_setlk64(unsigned int fd, struct file *file, #endif static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg) { - return 0; + return -EINVAL; } static inline int fcntl_getlease(struct file *filp) { - return 0; + return F_UNLCK; } static inline void locks_init_lock(struct file_lock *fl) -- 1.9.3