From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Jean-Pierre_Andr=E9?= Subject: Re: [fuse-devel] [PATCH] vfs: fix propagation of atomic_open create error on negative dentry Date: Thu, 16 Aug 2012 11:51:02 +0200 Message-ID: <502CC286.8040001@wanadoo.fr> References: <87has3dx1c.fsf@tucsk.pomaz.szeredi.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Sage Weil , fuse-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org To: Miklos Szeredi Return-path: Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:39460 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752602Ab2HPJvr (ORCPT ); Thu, 16 Aug 2012 05:51:47 -0400 In-Reply-To: <87has3dx1c.fsf@tucsk.pomaz.szeredi.hu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, Miklos Szeredi wrote: > Sage Weil writes: > > >> Hi Miklos, >> >> I found some time to track down the O_CREAT error code issue. Patch is >> below. Does this look correct? >> >> I was reproducing with >> >> ceph-fuse mnt >> mkdir -p mnt/a >> cd mnt >> .../pjd-fstest-20080816/fstest -u 65534 -g 65534 open a/foo O_RDONLY,O_CREAT 0644 >> >> EACCES is expected, ENOENT was returned instead. >> > I don't quite undersdand what is happending here. > > Why does ceph-fuse return ENOENT here? Returning ENOENT for O_CREAT > only makes sense if the parent directory doesn't exist, but that's not > the case here. > In this test, the parent directory exists, but it is not writable by the process which tries to create the file. According to opengroup, from http://pubs.opengroup.org/onlinepubs/000095399/functions/open.html The /open/() function shall fail if: [EACCES] Search permission is denied on a component of the path prefix, or the file exists and the permissions specified by /oflag/ are denied, or *the file does not exist and write permission is denied for the parent directory of the file to be created*, or O_TRUNC is specified and write permission is denied. Regards Jean-Pierre