Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id F1EC71715CA for ; Mon, 2 Jan 2012 17:00:38 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rhozj-0004Yi-3h for pgsql-bugs@postgresql.org; Mon, 02 Jan 2012 21:00:39 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q02L0Koq002114; Mon, 2 Jan 2012 16:00:20 -0500 (EST) To: Alvaro Herrera cc: Magnus Hagander , anjali_524 , Pg Bugs Subject: Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS In-reply-to: <1325537384-sup-6201@alvh.no-ip.org> References: <1149.1325535272@sss.pgh.pa.us> <1476.1325536113@sss.pgh.pa.us> <1325537384-sup-6201@alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Mon, 02 Jan 2012 17:53:08 -0300" Date: Mon, 02 Jan 2012 16:00:19 -0500 Message-ID: <2113.1325538019@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -3.2 (---) X-Archive-Number: 201201/12 X-Sequence-Number: 32079 Alvaro Herrera writes: > Excerpts from Tom Lane's message of lun ene 02 17:28:33 -0300 2012: >> it seems like EINVAL is a considerably more reasonable thing to return >> than EBADF, if the filesystem is trying to tell you that it won't fsync >> a directory. So I'm a bit surprised this question hasn't come up for >> other filesystems. > Probably because other filesystems do allow you to fsync directories. > In fact for some cases they _require_ it ... remember the fiasco when > MTA writers were told that they needed to fsync their queue dirs in > order for all queued email to persist? Yeah, the long and the short of it is that if the filesystem won't accept an fsync on a directory, we have to assume that it doesn't need it and will manage metadata persistence safely without prodding. The only real question here is whether an EINVAL could mean something besides "fsync on directory is not accepted". If there are any scenarios where it represents a transient/fixable error, then we'd want to report it. It's far from clear to me that there are any though. What it could mean in general is not at issue, because we know the target is a directory that we just created moments before. regards, tom lane