From: Bodo Eggert <7eggert@gmx.de>
To: Pavel Machek <pavel@ucw.cz>
Cc: Theodore Tso <tytso@mit.edu>, Bodo Eggert <7eggert@gmx.de>,
Artem Bityutskiy <dedekind@yandex.ru>,
Artem Bityutskiy <Artem.Bityutskiy@nokia.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: replace() system call needed (was Re: EXT4-ish "fixes" in UBIFS)
Date: Thu, 2 Apr 2009 00:58:20 +0200 (CEST) [thread overview]
Message-ID: <alpine.LSU.0.999.0904020025180.6204@be1.lrz> (raw)
In-Reply-To: <20090401205201.GI17808@elf.ucw.cz>
On Wed, 1 Apr 2009, Pavel Machek wrote:
> On Tue 2009-03-31 20:06:57, Theodore Tso wrote:
> > On Tue, Mar 31, 2009 at 11:27:33PM +0200, Bodo Eggert wrote:
> > > This can be done using implicit logic:
> > >
> > > ->E.g. on close(), mark inodes without being sync()ed as poisoned.
> > > (I can think of more sophisticated logic, but ...)
> > > ->On completing the inode with the delayed allocations, unpoison it.
> > > ->Don't commit rename()s if the corresponding inode is poisoned.
> >
> > Send us patches if you think it's that easy to do what you are
> > proposing. I assure it's not easy.
>
> Well, implementing replace() syscall would be quite easy. Would you
> want such a patch?
You'd need - minus setting the flag on close - about the same logic:
- detecting if the inode are dirty
- detecting when the inode gets into a clean state
- delaying the commit of the rename() until then
- not replaying parts of the journal
As I understand, the replace() should not behave different from rename(),
except for making a guaranty. Since this guaranty is desired anyway, I
think making it automatically would be a good thing. Especially until
all applications are rewritten ...
Off cause if you call replace, you know it's going to be OK, but you could
also use pathconf($configdir, _PC_SYNC_BEFORE_RENAME)
(== 0: Sync or barrier implicit, (data = ordered)
1: small chance of data loss due to not syncing, (vfat?)
2: guarantee of data loss without sync (ext4))
// userspace.c
static inline int sync_before_rename(char * where, int is_important_data)
{
#ifndef _PC_SYNC_BEFORE_RENAME
// be optimistic for unimportant data
return is_important_data;
#else
int ret = pathconf(where, _PC_SYNC_BEFORE_RENAME);
if (is_important_data)
return ret;
return (ret > 1);
#endif
}
--
How do I set my laser printer on stun?
next prev parent reply other threads:[~2009-04-01 22:58 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <ckjPq-2Dl-15@gated-at.bofh.it>
[not found] ` <cl2jy-65z-1@gated-at.bofh.it>
[not found] ` <cl2CZ-6q2-21@gated-at.bofh.it>
[not found] ` <cl2N9-6Bj-9@gated-at.bofh.it>
2009-03-31 21:27 ` Bodo Eggert
2009-04-01 0:06 ` Theodore Tso
2009-04-01 20:52 ` Pavel Machek
2009-04-01 22:58 ` Bodo Eggert [this message]
2009-03-27 12:48 EXT4-ish "fixes" in UBIFS Artem Bityutskiy
2009-03-29 12:26 ` replace() system call needed (was Re: EXT4-ish "fixes" in UBIFS) Pavel Machek
2009-03-29 12:42 ` Artem Bityutskiy
2009-03-29 12:50 ` Pavel Machek
2009-03-29 13:00 ` Artem Bityutskiy
2009-03-29 13:02 ` Pavel Machek
2009-03-29 13:07 ` Artem Bityutskiy
2009-03-29 13:22 ` Andreas T.Auer
2009-03-29 13:55 ` Artem Bityutskiy
2009-03-29 13:40 ` Pavel Machek
2009-03-29 13:57 ` Artem Bityutskiy
2009-03-29 14:00 ` Pavel Machek
2009-03-30 17:19 ` Ric Wheeler
2009-03-30 22:11 ` Pavel Machek
2009-03-29 13:01 ` Andreas T.Auer
2009-03-29 13:06 ` Artem Bityutskiy
2009-03-30 15:58 ` Diego Calleja
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LSU.0.999.0904020025180.6204@be1.lrz \
--to=7eggert@gmx.de \
--cc=Artem.Bityutskiy@nokia.com \
--cc=dedekind@yandex.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®