linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [fuse] How to trigger writeback?
@ 2018-09-24  8:02 Nikolaus Rath
  2018-09-24  8:15 ` Miklos Szeredi
  0 siblings, 1 reply; 5+ messages in thread
From: Nikolaus Rath @ 2018-09-24  8:02 UTC (permalink / raw)
  To: linux-fsdevel, fuse-devel, Maxim Patlasov, Miklos Szeredi

Hi,

How do I trigger writeback from a (writeback-cache enabled) FUSE
filesystem?

Background: I am emulating the reflink ioctl with a magic xattr, but for
that to work the filesystem needs to have all the data that is supposed
to be in the copied file.


Best,
Nikolaus

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [fuse] How to trigger writeback?
  2018-09-24  8:02 [fuse] How to trigger writeback? Nikolaus Rath
@ 2018-09-24  8:15 ` Miklos Szeredi
  2018-09-25  8:30   ` [fuse-devel] " Nikolaus Rath
  0 siblings, 1 reply; 5+ messages in thread
From: Miklos Szeredi @ 2018-09-24  8:15 UTC (permalink / raw)
  To: linux-fsdevel, fuse-devel, Maxim Patlasov, Miklos Szeredi

On Mon, Sep 24, 2018 at 10:02 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
> Hi,
>
> How do I trigger writeback from a (writeback-cache enabled) FUSE
> filesystem?

No way, currently (well, triggering fsync(2)/fdatasync(2) on the
filesystem would work, but such recursion is considered highly
hackish).

I'm working on new interfaces that will allow, among other things,
triggering sync from the server.

> Background: I am emulating the reflink ioctl with a magic xattr, but for
> that to work the filesystem needs to have all the data that is supposed
> to be in the copied file.

Have a look at the copyfile patch on the for-next branch of

  git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git

Adding reflink support based on that should be pretty simple (and it
takes care of flushing dirty pages).

Thanks,
Miklos

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [fuse-devel] [fuse] How to trigger writeback?
  2018-09-24  8:15 ` Miklos Szeredi
@ 2018-09-25  8:30   ` Nikolaus Rath
  2018-09-25  8:48     ` Miklos Szeredi
  0 siblings, 1 reply; 5+ messages in thread
From: Nikolaus Rath @ 2018-09-25  8:30 UTC (permalink / raw)
  To: fuse-devel, Miklos Szeredi, linux-fsdevel

On Sep 24 2018, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Mon, Sep 24, 2018 at 10:02 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
>> Hi,
>>
>> How do I trigger writeback from a (writeback-cache enabled) FUSE
>> filesystem?
>
> No way, currently (well, triggering fsync(2)/fdatasync(2) on the
> filesystem would work, but such recursion is considered highly
> hackish).


You mean sync(2)/syncfs(2), not fsync(), right? Unless my manpages are
out of date, fsync() only works on a specific inode.


Best,
-Nikolaus

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [fuse-devel] [fuse] How to trigger writeback?
  2018-09-25  8:30   ` [fuse-devel] " Nikolaus Rath
@ 2018-09-25  8:48     ` Miklos Szeredi
  2018-09-27  8:28       ` Nikolaus Rath
  0 siblings, 1 reply; 5+ messages in thread
From: Miklos Szeredi @ 2018-09-25  8:48 UTC (permalink / raw)
  To: fuse-devel, Miklos Szeredi, linux-fsdevel

On Tue, Sep 25, 2018 at 10:30 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
> On Sep 24 2018, Miklos Szeredi <miklos@szeredi.hu> wrote:
>> On Mon, Sep 24, 2018 at 10:02 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
>>> Hi,
>>>
>>> How do I trigger writeback from a (writeback-cache enabled) FUSE
>>> filesystem?
>>
>> No way, currently (well, triggering fsync(2)/fdatasync(2) on the
>> filesystem would work, but such recursion is considered highly
>> hackish).
>
>
> You mean sync(2)/syncfs(2), not fsync(), right? Unless my manpages are
> out of date, fsync() only works on a specific inode.

I would've thought you only need writeback of a specific inode for reflink, no?

Thanks,
Miklos

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [fuse-devel] [fuse] How to trigger writeback?
  2018-09-25  8:48     ` Miklos Szeredi
@ 2018-09-27  8:28       ` Nikolaus Rath
  0 siblings, 0 replies; 5+ messages in thread
From: Nikolaus Rath @ 2018-09-27  8:28 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: fuse-devel, Miklos Szeredi, linux-fsdevel

On Sep 25 2018, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Tue, Sep 25, 2018 at 10:30 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
>> On Sep 24 2018, Miklos Szeredi <miklos@szeredi.hu> wrote:
>>> On Mon, Sep 24, 2018 at 10:02 AM, Nikolaus Rath <Nikolaus@rath.org> wrote:
>>>> Hi,
>>>>
>>>> How do I trigger writeback from a (writeback-cache enabled) FUSE
>>>> filesystem?
>>>
>>> No way, currently (well, triggering fsync(2)/fdatasync(2) on the
>>> filesystem would work, but such recursion is considered highly
>>> hackish).
>>
>>
>> You mean sync(2)/syncfs(2), not fsync(), right? Unless my manpages are
>> out of date, fsync() only works on a specific inode.
>
> I would've thought you only need writeback of a specific inode for reflink, no?

Aeh, yeah, I did not mention that. Since I couldn't implement real
reflink support but have to go through xattrs, my "reflink" also
supports reflinking entire directory trees. I guess I could still issue
a bunch of fsyncs(), but I think syncfs() is nicer (I can even move it
into the client program that sets the magic xattr so that the filesystem
does not call into itself).


Best,
-Nikolaus

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-27 14:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-24  8:02 [fuse] How to trigger writeback? Nikolaus Rath
2018-09-24  8:15 ` Miklos Szeredi
2018-09-25  8:30   ` [fuse-devel] " Nikolaus Rath
2018-09-25  8:48     ` Miklos Szeredi
2018-09-27  8:28       ` Nikolaus Rath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).