Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752421Ab0HRA2j (ORCPT ); Tue, 17 Aug 2010 20:28:39 -0400 Received: from mtoichi12.ns.itscom.net ([219.110.2.182]:64923 "EHLO mtoichi12.ns.itscom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752235Ab0HRA2d (ORCPT ); Tue, 17 Aug 2010 20:28:33 -0400 From: "J. R. Okajima" Subject: Re: Union mounts and file locks (was Re: [PATCH 14/39] union-mount: Union mounts documentation) To: Valerie Aurora Cc: "J. Bruce Fields" , Neil Brown , Alexander Viro , Miklos Szeredi , Jan Blunck , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org In-Reply-To: <20100817210610.GF5556@shell> References: <20100817210610.GF5556@shell> Date: Wed, 18 Aug 2010 09:27:36 +0900 Message-ID: <6194.1282091256@jrobl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1333 Lines: 32 Valerie Aurora: > Union mounts behaves this way with locks for the same reason as > fchmod(), etc. on O_RDONLY file descriptors fails. In-kernel copyup > only happens before a file descriptor is open. Once it is open, it is > very difficult to switch the open file with the newly copied up file > ("very difficult" meaning "Al Viro refuses to even discuss it"). Laugh, laugh, laugh. But this is one of the major difference between "union in VFS" and "union as FS". By the union implemented as FS, the file object will be a virtual one in a virtual FS, and you can switch two real files on the layers in the virtual object. > However, fcntl(F_SETLK) on a file opened read-write will behave > exactly as expected. The question is how many applications call > fcntl(F_SETLK) on a read-only file descriptor as the first lock > operation on a file? Of those applications, how many could easily be > rewritten to open that file descriptor with write permissions? I don't know. If users never use such AP or never meet the problem, then there will be no actual problem. J. R. Okajima -- 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/