Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761198AbXIZS72 (ORCPT ); Wed, 26 Sep 2007 14:59:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753099AbXIZS7V (ORCPT ); Wed, 26 Sep 2007 14:59:21 -0400 Received: from mail-gw3.sa.ew.hu ([212.108.200.82]:36685 "EHLO mail-gw3.sa.ew.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754810AbXIZS7V (ORCPT ); Wed, 26 Sep 2007 14:59:21 -0400 To: haveblue@us.ibm.com CC: miklos@szeredi.hu, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, hch@infradead.org In-reply-to: <1190830135.30530.32.camel@localhost> (message from Dave Hansen on Wed, 26 Sep 2007 11:08:55 -0700) Subject: Re: missing mnt_drop_write() on open error References: <1190769669.26982.325.camel@localhost> <1190823545.30530.19.camel@localhost> <1190830135.30530.32.camel@localhost> Message-Id: From: Miklos Szeredi Date: Wed, 26 Sep 2007 20:54:32 +0200 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 707 Lines: 21 > > Btw, may_open() doesn't do mnt_want_write() around the truncation if > > file is opened with O_TRUNC | O_RDONLY. > > What's the path to may_open() in that case? open_namei() should wrap > all callers other than nfs, and it does: > > /* O_TRUNC implies we need access checks for write permissions */ > if (flag & O_TRUNC) > acc_mode |= MAY_WRITE; > > Which should trigger the may_open() code. Ah, I missed that. Thanks, Miklos - 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/