提交 1b2b32dc 编写于 作者: J Jeff Layton

locks: fix fcntl_setlease/getlease return when !CONFIG_FILE_LOCKING

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: NJeff Layton <jlayton@primarydata.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
上级 6e129d00
...@@ -1008,12 +1008,12 @@ static inline int fcntl_setlk64(unsigned int fd, struct file *file, ...@@ -1008,12 +1008,12 @@ static inline int fcntl_setlk64(unsigned int fd, struct file *file,
#endif #endif
static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg) 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) static inline int fcntl_getlease(struct file *filp)
{ {
return 0; return F_UNLCK;
} }
static inline void locks_init_lock(struct file_lock *fl) static inline void locks_init_lock(struct file_lock *fl)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册