From: Bernd Schubert Subject: Re: [PATCH] staging/lustre/llite: fix O_TMPFILE/O_LOV_DELAY_CREATE conflict Date: Tue, 04 Feb 2014 13:13:52 +0100 Message-ID: <52F0D980.5030801@itwm.fraunhofer.de> References: <1391468877-4244-1-git-send-email-andreas.dilger@intel.com> <20140204041009.GC20451@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, Oleg Drokin , Peng Tao To: Greg KH , Andreas Dilger Return-path: Received: from mailgw1.uni-kl.de ([131.246.120.220]:36859 "EHLO mailgw1.uni-kl.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbaBDMN5 (ORCPT ); Tue, 4 Feb 2014 07:13:57 -0500 Received: from itwm2.itwm.fhg.de (itwm2.itwm.fhg.de [131.246.191.3]) by mailgw1.uni-kl.de (8.14.3/8.14.3/Debian-9.4) with ESMTP id s14CDsmo004822 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT) for ; Tue, 4 Feb 2014 13:13:55 +0100 In-Reply-To: <20140204041009.GC20451@kroah.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 02/04/2014 05:10 AM, Greg KH wrote: > On Mon, Feb 03, 2014 at 04:07:57PM -0700, Andreas Dilger wrote: >> In kernel 3.11 O_TMPFILE was introduced, but the open flag value >> conflicts with the O_LOV_DELAY_CREATE flag 020000000 previously used >> by Lustre-aware applications. O_LOV_DELAY_CREATE allows applications >> to defer file layout and object creation from open time (the default) >> until it can instead be specified by the application using an ioctl. >> >> Instead of trying to find a non-conflicting O_LOV_DELAY_CREATE flag >> or define a Lustre-specific flag that isn't of use to most/any other >> filesystems, use (O_NOCTTY|FASYNC) as the new value. These flag >> are not meaningful for newly-created regular files and should be >> OK since O_LOV_DELAY_CREATE is only meaningful for new files. >> >> I looked into using O_ACCMODE/FMODE_WRITE_IOCTL, which allows calling >> ioctl() on the minimally-opened fd and is close to what is needed, >> but that doesn't allow specifying the actual read or write mode for >> the file, and fcntl(F_SETFL) doesn't allow O_RDONLY/O_WRONLY/O_RDWR >> to be set after the file is opened. >> >> Lustre-change: http://review.whamcloud.com/8312 >> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4209 >> Signed-off-by: Andreas Dilger >> Signed-off-by: Oleg Drokin >> Signed-off-by: Peng Tao >> --- >> .../lustre/lustre/include/lustre/lustre_user.h | 12 ++++------ >> drivers/staging/lustre/lustre/include/lustre_mdc.h | 11 ++++++++++ >> drivers/staging/lustre/lustre/llite/file.c | 21 ++++++++++--------- >> drivers/staging/lustre/lustre/mdc/mdc_lib.c | 2 +- >> 4 files changed, 28 insertions(+), 18 deletions(-) > > As you are abusing well known file flags, I can't accept any patch that > doesn't get accepted by the linux-fsdev developers as well, please > repost this there and cc: me for the fun discussion :) > I think it makes sense anyway to make this flag a generic feature. I.e. delayed file layout creation solves the splice-copy-offload issue for most (all?) object storage file systems. https://lkml.org/lkml/2013/9/30/421 Thanks, Bernd