* linux fsync behaviour
@ 2014-07-24 22:41 yuanh
2014-07-25 1:17 ` Dave Chinner
0 siblings, 1 reply; 3+ messages in thread
From: yuanh @ 2014-07-24 22:41 UTC (permalink / raw)
To: linux-kernel
Hi all,
Two file descriptors are pointing the same file. When fsync is called on
one fd, the data written by the other fd will also be flushed? We are using
linux XFS.
Thanks,
-Yuan
--
View this message in context: http://linux-kernel.2935.n7.nabble.com/linux-fsync-behaviour-tp911707.html
Sent from the Linux Kernel mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: linux fsync behaviour
2014-07-24 22:41 linux fsync behaviour yuanh
@ 2014-07-25 1:17 ` Dave Chinner
2014-07-25 7:15 ` Anton Altaparmakov
0 siblings, 1 reply; 3+ messages in thread
From: Dave Chinner @ 2014-07-25 1:17 UTC (permalink / raw)
To: yuanh; +Cc: linux-kernel
On Thu, Jul 24, 2014 at 03:41:31PM -0700, yuanh wrote:
> Hi all,
>
> Two file descriptors are pointing the same file. When fsync is called on
> one fd, the data written by the other fd will also be flushed? We are using
> linux XFS.
Yes.
-Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: linux fsync behaviour
2014-07-25 1:17 ` Dave Chinner
@ 2014-07-25 7:15 ` Anton Altaparmakov
0 siblings, 0 replies; 3+ messages in thread
From: Anton Altaparmakov @ 2014-07-25 7:15 UTC (permalink / raw)
To: yuanh; +Cc: linux-kernel
Hi,
On 25 Jul 2014, at 02:17, Dave Chinner <david@fromorbit.com> wrote:
> On Thu, Jul 24, 2014 at 03:41:31PM -0700, yuanh wrote:
>> Hi all,
>>
>> Two file descriptors are pointing the same file. When fsync is called on
>> one fd, the data written by the other fd will also be flushed? We are using
>> linux XFS.
>
> Yes.
But beware of the common mistake of using fwrite + fsync which does not actually do what you intend at all and you must instead use fwrite + fflush + fsync... If you are using write(2) then just fsync is obviously fine.
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
University of Cambridge Information Services, Roger Needham Building
7 JJ Thomson Avenue, Cambridge, CB3 0RB, UK
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-25 7:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-24 22:41 linux fsync behaviour yuanh
2014-07-25 1:17 ` Dave Chinner
2014-07-25 7:15 ` Anton Altaparmakov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox