Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 2026117A9D8 for ; Fri, 6 Jan 2012 13:49:59 -0400 (AST) Received: from nm1-vm0.bullet.mail.in.yahoo.com ([121.101.151.211]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1RjDvQ-0001pz-Tx for pgsql-bugs@postgresql.org; Fri, 06 Jan 2012 17:49:58 +0000 Received: from [121.101.151.237] by nm1.bullet.mail.in.yahoo.com with NNFMP; 06 Jan 2012 17:49:42 -0000 Received: from [121.101.151.235] by tm2.bullet.mail.in.yahoo.com with NNFMP; 06 Jan 2012 17:50:13 -0000 Received: from [127.0.0.1] by omp1004.mail.in.yahoo.com with NNFMP; 06 Jan 2012 17:49:42 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 771634.22631.bm@omp1004.mail.in.yahoo.com Received: (qmail 2724 invoked by uid 60001); 6 Jan 2012 17:49:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s1024; t=1325872182; bh=NvkHIk+ac2sQy2jZw5vyCYPq1+7XQIK/+PvbbSxLsMc=; 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=tu82IEJIuwWJgLhZaUH5P9eaM2WFiINr7mrYAfOyfbFvDg44Bkgwn0PDZXwHnUwIWe0yFLdxGYMWGRHinTkV377oVpul9rqs/nDjORUj5a57Dz/PwErfFQ9cLGNu2sHgZDxtsiwoAVmmiLplfWOqVy4d9soBJjM9pWTvxRFq4ak= 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=jkPn8g02Sa2S8wQswq6CWdb7utGujAYJj4OClxA/p1b3ldGBAOvF4H6P1W63maK6Z/TY2HpsSnE5EW/H6PHm6iVfQ3Bxa/Ez/rPi+rEpqbzT5XisXhW4lUimmlbkG8ArL2pgxw1pwKQb3i6Slq9NmbBUN9ViDxOfbDEMYcM+a4s=; X-YMail-OSG: F69uwQwVM1kJ9Mea9L7QIWzf0_mmJYgMGwduCEIjwYVVt_u zj_RPXuiPEhENaG49xQB5HRcx1GtVOQydDFjgN4CTt8ZmzOLdHJMw4gy7Dtz WlQxNsXXh2nfxQLbJaldFjak1dcyo_hcdya0utNc63okdL5ytC7kcu6ytZ7x 05DmCh_gF.CsTwnbNVNMhLk0U5ETVMwCajiocjwrtrRd907qOCN9.sNBiWcC ..Ak_oL8ET9XUsC4DLeIm6ueDQZAUr.RWboai8n4ex_CE7U5J81TZDtFoU0g RQ8_IXSbPON9iHAeaQAHnQvyMPaBukNaoYXrWCxaGrjBeRiTtcm3Ukw4xgKR ydUNqXvaG09kLufOzuNQ5sME1tjHUf1ND2jKB3aKOC6UFju.9N9JHI5EdFl1 AeV0FbPzMl6V4pehfK7yGQM6zPtCmgiPHxQVY32NYg3wT67U9bgmGLvBXRZt fjB3oPqq82tZEoxB.uF4_5dtsInt7GarNGIa2UrHNGPwXO1DSPzLmGHCLtTA gsearoJdnnxGBjBH48kGmZuOQQhCFiwF6.iSmomuaob0rgS3mJPcM Received: from [49.249.112.62] by web95516.mail.in.yahoo.com via HTTP; Fri, 06 Jan 2012 23:19:41 IST X-Mailer: YahooMailWebService/0.8.115.331698 References: <1149.1325535272@sss.pgh.pa.us> <1476.1325536113@sss.pgh.pa.us> Message-ID: <1325872181.2644.YahooMailNeo@web95516.mail.in.yahoo.com> Date: Fri, 6 Jan 2012 23:19:41 +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="-2052119964-277197676-1325872181=:2644" X-Pg-Spam-Score: -1.5 (-) X-Archive-Number: 201201/42 X-Sequence-Number: 32109 ---2052119964-277197676-1325872181=:2644 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=A0i= ngnoring EINVAL in copydir.c. =0A=A0=0AI tested fsync with 8.2.2 version of= PostgreSQL, it worked fine without EINVAL patch. I wanted to know is somet= hing changed in version 9.0.4 of postgreSQL.=0A=A0=0AAs=A0fsync flag=A0was = not working with PostgreSQL version 9.0.4 without applying the patch.=0A=A0= =0ARegards,=0AAnjali=0A =0A=0A________________________________=0A From: Mag= nus Hagander =0ATo: Tom Lane =0ACc= : anjali_524@yahoo.co.in; pgsql-bugs@postgresql.org =0ASent: Tuesday, 3 Jan= uary 2012 2:00 AM=0ASubject: Re: [BUGS] BUG #6372: Error while creating dat= abase with fsync parameter as on incase of CIFS=0A =0AOn Mon, Jan 2, 2012 a= t 21: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 support CIFS in=0A>>> general? =A0It's probably not terribly bulletproof,= but any worse than NFS?=0A>=0A>> Yes, it is a lot worse than NFS from expe= rience. I can't find a=0A>> reference to it anywhere now, but IIRC there ar= e bigger issues - with=0A>> blocksizes, with syncing not properly, with wri= te ordering.=0A>=0A> Hmm. =A0I searched the list archives and couldn't find= any previous=0A> discussion of such things, but that may just prove that n= o one 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= been about the win32 cifs *client*.=0AIt was at the time just talking wind= ows cifs client -> windows cifs=0Aserver.=0A=0A=0A=0A> Anyway the immediate= question is which errnos are reasonable for copydir=0A> to ignore. =A0Just= looking 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= [EBADF]=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 int= errupted by a signal.=0A> =A0 =A0 =A0 =A0[EINVAL]=0A> =A0 =A0 =A0 =A0The fi= ldes 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 re= ading from or writing to the file system.=0A>=0A> it seems like EINVAL is a= considerably more reasonable thing to return=0A> than EBADF, if the filesy= stem 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= =0AAgreed. But do we really want to accept this with fsync=3Don? It=0Abasic= ally means fsync=3Dmaybe, no?=0A=0A-- =0A=A0Magnus Hagander=0A=A0Me: http:/= /www.hagander.net/=0A=A0Work: http://www.redpill-linpro.com/ ---2052119964-277197676-1325872181=:2644 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 ve= rsion of PostgreSQL, it worked fine without EINVAL patch. I wanted to know = is something changed in version 9.0.4 of postgreSQL.
 
As fsync flag was not working with= PostgreSQL version 9.0.4 without applying the patch.
 
Regards,
Anjali

From: Magnus Hagander <magnus@hagande= r.net>
To: Tom Lane= <tgl@sss.pgh.pa.us>
Cc: anjali_524@yahoo.co.in; pgsql-bugs@postgresql.org
Sent: Tuesday, 3 January 2012 2:00 AM=
Subject: Re: [BUGS] B= UG #6372: Error while creating database with fsync parameter as on incase o= f CIFS

On Mon, Jan 2, 2012 at 21:28, Tom Lane <tgl@sss.= pgh.pa.us> wrote:
> 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/


---2052119964-277197676-1325872181=:2644--