From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-am1on0142.outbound.protection.outlook.com ([157.56.112.142]:5861 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752621AbcFCWWL (ORCPT ); Fri, 3 Jun 2016 18:22:11 -0400 To: Miklos Szeredi CC: , linux-fsdevel , Kinsbursky Stanislav From: Maxim Patlasov Subject: fuse does not show lock info in /proc/.../fdinfo/... Message-ID: <5751D130.5010202@virtuozzo.com> Date: Fri, 3 Jun 2016 11:49:20 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi Miklos, fuse_file_lock() since its inception in 2006 implements F_SETLK command like this: > if (fc->no_lock) > err = posix_lock_file(file, fl, NULL); > else > err = fuse_setlk(file, fl, 0); where fc->no_lock is a per-mount-point tunable. It would be more natural to posix-lock in both cases, like this: > err = posix_lock_file(file, fl, NULL); > if (!err && !fc->no_lock) > err = fuse_setlk(file, fl, 0); Otherwise, by default, when fc->no_lock=0, posix_lock_file() is never called, and from end-user perspective it is weird that the file was locked successfully, but "fdinfo" does not show the lock. Do you think there were some reasons to implement it that way -- not calling posix_lock_file unconditionally? Thanks, Maxim