From: Benjamin LaHaise Subject: tmpfs bug: open("/dev/shm/foo", O_RDWR | O_CREAT | O_EXCL | O_DIRECT) Date: Fri, 4 Sep 2015 14:35:38 -0400 Message-ID: <20150904183538.GJ6525@kvack.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Al Viro Return-path: Received: from kanga.kvack.org ([205.233.56.17]:52576 "EHLO kanga.kvack.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932954AbbIDSw5 (ORCPT ); Fri, 4 Sep 2015 14:52:57 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi Al, everyone, I've come across the following odd behaviour of open() on tmpfs. When a file is opened open("/dev/shm/foo", O_RDWR | O_CREAT | O_EXCL | O_DIRECT), open() fails with EINVAL. This failure is expected, as tmpfs doesn't support O_DIRECT. What is unexpected is that the file is created and a subsequent attempt to create the file by doing an open("/dev/shm/foo", O_RDWR | O_CREAT | O_EXCL). I consider this to be a bug. Al, any thoughts? -ben -- "Thought is the essence of where you are now."