Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932071AbbFAPpR (ORCPT ); Mon, 1 Jun 2015 11:45:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39187 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751783AbbFAPpI (ORCPT ); Mon, 1 Jun 2015 11:45:08 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <21902.1433166736@warthog.procyon.org.uk> To: Miklos Szeredi Cc: dhowells@redhat.com, Al Viro , Kernel Mailing List , Linux-Fsdevel , "linux-unionfs@vger.kernel.org" Subject: Re: Can ovl_drop_write() be called earlier in ovl_dentry_open() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16822.1433173503.1@warthog.procyon.org.uk> Date: Mon, 01 Jun 2015 16:45:03 +0100 Message-ID: <16823.1433173503@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 798 Lines: 19 Miklos Szeredi wrote: > > In ovl_dentry_open(), ovl_drop_write() is called after vfs_open() - but is > > this actually necessary? Can't we just drop it post-copyup? After all, > > that's all we wanted the write lock for, right? > > Hmm, that could result in a race where remount r/o of upper fs comes > in between copy-up and vfs_open() so copy-up succeeds but the actual > open fails. It's harmless, though, and not very likely. So I guess > your patch is OK. That race is there anyway if there's no copy up, right? David -- 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/