Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 47C3E1715CE for ; Mon, 2 Jan 2012 16:53:33 -0400 (AST) Received: from 30.55.colo.spiretech.net ([69.168.55.30] helo=lists.commandprompt.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rhosr-0004Jv-Eu for pgsql-bugs@postgresql.org; Mon, 02 Jan 2012 20:53:33 +0000 Received: from perhan.alvh.no-ip.org (spinlock.commandprompt.com [69.168.55.30]) by lists.commandprompt.com (Postfix) with ESMTPA id 574D6AE; Mon, 2 Jan 2012 12:53:28 -0800 (PST) Received: from perhan.alvh.no-ip.org ([200.126.85.47] helo=perhan.alvh.no-ip.org) by assp.commandprompt.com with ESMTPS(AES256-SHA) (2.1.1); 2 Jan 2012 12:53:25 -0800 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id C95F26E491; Mon, 2 Jan 2012 17:53:08 -0300 (CLST) Content-Type: text/plain; charset=UTF-8 Cc: Magnus Hagander , anjali_524 , Pg Bugs Subject: Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS From: Alvaro Herrera To: Tom Lane In-reply-to: <1476.1325536113@sss.pgh.pa.us> References: <1149.1325535272@sss.pgh.pa.us> <1476.1325536113@sss.pgh.pa.us> Date: Mon, 02 Jan 2012 17:53:08 -0300 Message-Id: <1325537384-sup-6201@alvh.no-ip.org> User-Agent: Sup/git X-Assp-Version: 2.1.1(11278) on assp.commandprompt.com X-Assp-Client-TLS: yes X-Assp-ID: assp.commandprompt.com m1-37608-10686 X-Assp-Envelope-From: alvherre@alvh.no-ip.org X-Assp-Intended-For: magnus@hagander.net X-Assp-Original-Subject: Re: [BUGS] BUG #6372: Error while creating database with fsync parameter as on incase of CIFS Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: 0.3 (/) X-Archive-Number: 201201/11 X-Sequence-Number: 32078 Excerpts from Tom Lane's message of lun ene 02 17:28:33 -0300 2012: > Anyway the immediate question is which errnos are reasonable for copydi= r > to ignore. Just looking at the standard's description of fsync's error > conditions: >=20 > The fsync() function shall fail if: > [EBADF] > The fildes argument is not a valid descriptor. > [EINTR] > The fsync() function was interrupted by a signal. > [EINVAL] > The fildes argument does not refer to a file on which this operatio= n is possible. > [EIO] > An I/O error occurred while reading from or writing to the file sys= tem. >=20 > 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? --=20 =C3=81lvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support