Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id D3FECAF82E5 for ; Mon, 9 Jan 2012 01:14:14 -0400 (AST) Received: from nm3.bullet.mail.in.yahoo.com ([121.101.151.225]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Rk7Yg-0005QB-Hs for pgsql-bugs@postgresql.org; Mon, 09 Jan 2012 05:14:15 +0000 Received: from [121.101.151.236] by nm3.bullet.mail.in.yahoo.com with NNFMP; 09 Jan 2012 05:13:56 -0000 Received: from [121.101.151.234] by tm1.bullet.mail.in.yahoo.com with NNFMP; 09 Jan 2012 05:15:20 -0000 Received: from [127.0.0.1] by omp1003.mail.in.yahoo.com with NNFMP; 09 Jan 2012 05:16:03 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 546841.24539.bm@omp1003.mail.in.yahoo.com Received: (qmail 48828 invoked by uid 60001); 9 Jan 2012 05:13:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s1024; t=1326086035; bh=7lMpHTGyThGq/B1BOS7rcMzFGRdUOEjbAVssU1j85xQ=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=FAj/eR+tUBUxud5/AjEggpiWD/jm/m3NlvLxlAYzFkVAVYX/7I3RlzIBrit2eMniXjjhQ3Pt9+p2Rmv3FtUudI9MclfJb4dP4kZ7CTHxwHEhSgJfUFrSCIQoinlzsjL249wizW9TFq3bOg3T4x+afo3Feg+Sf1qxm6S/Z6gseAY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=yjPF4M/cNEyQ2qbNbATQ7WRXfQVKh8IeyuCDBG6puUZ65WKRpME7xDQKRF/ROvyKIpt9CUiJZgKR6PjD266j4cMH8PkR05sS1JQFJ7ffWfX+lucyheuTUCLsG10IcBvaO+zTJdpqLPCcl00OjpW3d6ZZ53NistlrS0vo82EEoqo=; X-YMail-OSG: 5B_cAZoVM1lh2R.mysvFF3hzMu_dB53RLBS3d9rSCPqad5W COUtFpEJjZAweoi2JJMRuhQsDss4kQKjWJBNA9OxnHQpS0QiS7KwzYn8Moxc 1WwFdvBBFHKFsS0rq.33oByMAZXd8p0WddKH_hRKIgcREVfp3cAOvidTjr2q xaB9E8UDyuT6qtjzX0nymg.0ltFS2mpHy7fINeMK9C2MYokBsZUMHVAgZSwJ 91c8qFO3qtJEQpWXQo24BkpuysPuwz7t7qZqqWt00lfVWTNSYUksShczWT1g 4vMAGio4c5jhGNs5kGHCQE4NBnXXhzO6vFI1UKOdR6PraXg7mtadFEMMSd5h DBE9j3btBX0nkzXNsybj5hfBEB2s7E3LgqqJY.7bJ6Q7DWC.csGV.RjdZehC IsYA4HfI6SElIbRSS9buDOtVnAVLu7JfkpZ9vngcf7B47NsKPj4yxkHWvZYT YUO1zJw_TzK1gmKij0M0glImldC4Uao0K4XPv6pq5PnxVIR3OjdGhMKZ4oXT 8qchfzjZOEccUzoXyQ8HjI2JpcG8SWLIQTyN7DgeG_.xX8NKD5OXfEw-- Received: from [49.249.113.224] by web95511.mail.in.yahoo.com via HTTP; Mon, 09 Jan 2012 10:43:55 IST X-Mailer: YahooMailWebService/0.8.115.331698 References: <1149.1325535272@sss.pgh.pa.us> <1476.1325536113@sss.pgh.pa.us> Message-ID: <1326086035.43672.YahooMailNeo@web95511.mail.in.yahoo.com> Date: Mon, 9 Jan 2012 10:43:55 +0530 (IST) From: Anjali Arora Reply-To: Anjali Arora Subject: Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS To: Magnus Hagander , Tom Lane Cc: "pgsql-bugs@postgresql.org" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1486285689-1987598190-1326086035=:43672" X-Pg-Spam-Score: -1.4 (-) X-Archive-Number: 201201/54 X-Sequence-Number: 32121 ---1486285689-1987598190-1326086035=:43672 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi Tom,=0A=A0=0AThanks for the solution. CIFS worked with fsync flag by ing= noring EINVAL in copydir.c. =0A=A0=0AI tested fsync with 8.2.2 version of P= ostgreSQL, it worked fine without EINVAL patch. I wanted to know is somethi= ng changed in version 9.0.4 of postgreSQL.=0A=A0=0AAs fsync flag was not wo= rking with PostgreSQL version 9.0.4 without applying the patch.=0A=A0=0AReg= ards,=0AAnjali=0A=0A =0A=0A________________________________=0A From: Magnus= Hagander =0ATo: Tom Lane =0ACc: a= njali_524@yahoo.co.in; pgsql-bugs@postgresql.org =0ASent: Tuesday, 3 Januar= y 2012 2:00 AM=0ASubject: Re: [BUGS] BUG #6372: Error while creating databa= se with fsync parameter as on incase of CIFS=0A =0AOn Mon, Jan 2, 2012 at 2= 1:28, Tom Lane wrote:=0A> Magnus Hagander writes:=0A>> On Mon, Jan 2, 2012 at 21:14, Tom Lane wrote:=0A>>> I'm wondering what's your basis for asserting we don't s= upport CIFS in=0A>>> general? =A0It's probably not terribly bulletproof, bu= t any worse than NFS?=0A>=0A>> Yes, it is a lot worse than NFS from experie= nce. I can't find a=0A>> reference to it anywhere now, but IIRC there are b= igger issues - with=0A>> blocksizes, with syncing not properly, with write = ordering.=0A>=0A> Hmm. =A0I searched the list archives and couldn't find an= y previous=0A> discussion of such things, but that may just prove that no o= ne thinks=0A> it's worth attempting.=0A=0AYeah, I don't think it was in our= archives, it was somewhere else.=0A=0AAnd as a disclaime r- it may have be= en about the win32 cifs *client*.=0AIt was at the time just talking windows= cifs client -> windows cifs=0Aserver.=0A=0A=0A=0A> Anyway the immediate qu= estion is which errnos are reasonable for copydir=0A> to ignore. =A0Just lo= oking at the standard's description of fsync's error=0A> conditions:=0A>=0A= > =A0 =A0 =A0 =A0The fsync() function shall fail if:=0A> =A0 =A0 =A0 =A0[EB= ADF]=0A> =A0 =A0 =A0 =A0The fildes argument is not a valid descriptor.=0A> = =A0 =A0 =A0 =A0[EINTR]=0A> =A0 =A0 =A0 =A0The fsync() function was interrup= ted by a signal.=0A> =A0 =A0 =A0 =A0[EINVAL]=0A> =A0 =A0 =A0 =A0The fildes = argument does not refer to a file on which this operation is possible.=0A> = =A0 =A0 =A0 =A0[EIO]=0A> =A0 =A0 =A0 =A0An I/O error occurred while reading= from or writing to the file system.=0A>=0A> it seems like EINVAL is a cons= iderably more reasonable thing to return=0A> than EBADF, if the filesystem = is trying to tell you that it won't fsync=0A> a directory. =A0So I'm a bit = surprised this question hasn't come up for=0A> other filesystems.=0A=0AAgre= ed. But do we really want to accept this with fsync=3Don? It=0Abasically me= ans fsync=3Dmaybe, no?=0A=0A-- =0A=A0Magnus Hagander=0A=A0Me: http://www.ha= gander.net/=0A=A0Work: http://www.redpill-linpro.com/ ---1486285689-1987598190-1326086035=:43672 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Tom,
 
Thanks for the solution.= CIFS worked with fsync flag by ingnoring EINVAL in copydir.c.
 
I tested fsync with 8.2.2 version= of PostgreSQL, it worked fine without EINVAL patch. I wanted to know is so= mething changed in version 9.0.4 of postgreSQL.
&nbs= p;
As fsync flag was not working with PostgreSQL ver= sion 9.0.4 without applying the patch.
 =
Regards,
Anjali

From: Magnus Hagander <magnus@hagander.net>
To: Tom Lane <tgl@sss.pgh.pa.u= s>
Cc: anjali_524@y= ahoo.co.in; pgsql-bugs@postgresql.org
Sent: Tuesday, 3 January 2012 2:00 AM
Subject: Re: [BUGS] BUG #6372: Error whi= le creating database with fsync parameter as on incase of CIFS
=
On Mon, Jan 2, 2012 at 21:28, Tom Lane <tgl@sss.pgh.pa.us> wro= te:
> Magnus Hagander <magnus@hagander.net> writes:=
>> On Mon, Jan 2, 2012 at 21:14, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> I'm wondering what's your basis for asserting = we don't support CIFS in
>>> general?  It's probably not t= erribly bulletproof, but any worse than NFS?
>
>> Yes, it is= a lot worse than NFS from experience. I can't find a
>> reference= to it anywhere now, but IIRC there are bigger issues - with
>> bl= ocksizes, with syncing not properly, with write ordering.
>
> H= mm.  I searched the list archives and couldn't find any previous
&g= t; discussion of such things, but that may just prove that no one thinks> it's worth attempting.

Yeah, I don't think it was in our archi= ves, it was somewhere else.

And as a disclaime r- it may have been about the win32 cifs *client*.
It was at the time just talking windows = cifs client -> windows cifs
server.



> Anyway the im= mediate question is which errnos are reasonable for copydir
> to igno= re.  Just looking at the standard's description of fsync's error
&g= t; conditions:
>
>        The fsync() funct= ion 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 operation is possible.
>   &n= bsp;    [EIO]
>        An I/O error occ= urred while reading from or writing to the file system.
>
> it seems like EINVAL is a considerably more reason= able thing to return
> than EBADF, if the filesystem is trying to tel= l you that it won't fsync
> a directory.  So I'm a bit surprised= this question hasn't come up for
> other filesystems.

Agreed.= But do we really want to accept this with fsync=3Don? It
basically mean= s fsync=3Dmaybe, no?

--
 Magnus Hagander
 Me:
http://www.hagander.net/<= /a>
 Work:
http://www.redpill-linpro.com/


---1486285689-1987598190-1326086035=:43672--