[PATCH] ubifs: Add new mount option to force fdatasync before rename

Richard Weinberger richard at nod.at
Tue Sep 29 10:52:28 PDT 2015


Hi!

Am 29.09.2015 um 19:04 schrieb Nikhilesh Reddy:
> Unfortunately major changes would not be completely up to me :(

hm?

> But before i spend time on it ... i was hoping to understand the disadvantages of this approach and the advantages of the other approach?
> Can you kindly help me understand?

Sure.
Instead of making rename() unconditionally synchronous we could do it like ext4 and detect rename+close patterns and make only
these synchronous.

So, your application does:
fd = open("foo", ...)
write(fd, "yadda yadda, ...)
close(fd)
rename("foo", "bar")

and then expects "bar" to exist with contents "yadda yadda"?

I'm asking because we also have to make sure that this is not an UBIFS bug.
We have to be careful, ext4 has a metadata journal, UBIFS' is different.

My point is that UBIFS better should detect the close+rename pattern then only then do rename synchronous.

> So the patch effectively converts all the rename to a fdatasync+rename which is what we would expect all the userspace applications to do anyway.

But there are also cases where you want a fast rename() and sync later.

Artem, what do you think?

Thanks,
//richard



More information about the linux-mtd mailing list