From: Jan Kara <jack@suse.cz>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
npiggin@suse.de
Subject: Re: [PATCH 0/7] vfs: notify_changes() error handling
Date: Mon, 22 Feb 2010 11:35:17 +0100 [thread overview]
Message-ID: <20100222103516.GA5131@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <1266608845-13212-1-git-send-email-dmonakhov@openvz.org>
Hi Dmitry,
> Current inode attr setting path looks like follows
>
> ret = inode_change_ok()
> if(ret)
> goto out;
> /*
> perform private-fs specific logic here
> */
> if(ia_valid & ATTR_UID || ...)
> ret = vfs_dq_transfer()
>
> /*
> more private-fs specific logic
> for example update on_disk data structures.
> */
>
> ret = inode_setattr()
>
> In fact inode_setattr() call vmtruncate() which may fail in number
> of reasons IS_SWAPFILE, RLIMIT_FSIZE. After this many filesystem is
> unable to rollback changes. And just live inode in inconsistent
> state. We may check IS_SWAPFILE at the very beginning(currently it
> is not checked), but RLIMIT_FSIZE may changed under our feet.
> In order make things straight. Let's divide vmtruncate() in to
> two parts which perform all checks, and second which can not fail.
> After this notify_change() perform all necessary checks inside
> inode_change_ok() and simply call nofail version of vmtruncate().
Actually, there are more problems than these in the truncate path. Some
filesystems can decide to fail truncate only in their .truncate method but that
is called only after i_size is set which is too late. Nick Piggin has a patch
set which was addressing this problem and should be basically a superset of
your changes. But I'm not sure whether the patch series is available somewhere
or what it's current status. Nick?
Honza
--
Jan Kara <jack@suse.cz>
SuSE CR Labs
next prev parent reply other threads:[~2010-02-22 10:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-19 19:47 [PATCH 0/7] vfs: notify_changes() error handling Dmitry Monakhov
2010-02-19 19:47 ` [PATCH 1/7] mm: add nofail version of vmtruncate() and inode_setattr() Dmitry Monakhov
2010-02-19 19:47 ` [PATCH 2/7] vfs: inode_change_ok have to perform all necessery checks Dmitry Monakhov
2010-02-19 19:47 ` [PATCH 3/7] vfs: do not allow inode_setattr() to fail after vfs_dq_transfer() Dmitry Monakhov
2010-02-19 19:47 ` [PATCH 4/7] ext2: use nofail variant of inode_setattr() Dmitry Monakhov
2010-02-19 19:47 ` [PATCH 5/7] ext3: " Dmitry Monakhov
2010-02-19 19:47 ` [PATCH 6/7] ext4: " Dmitry Monakhov
2010-02-19 19:47 ` [PATCH 7/7] ocfs2: " Dmitry Monakhov
2010-02-22 10:35 ` Jan Kara [this message]
2010-02-22 11:15 ` [PATCH 0/7] vfs: notify_changes() error handling Nick Piggin
2010-02-22 13:30 ` Dmitry Monakhov
2010-02-22 14:56 ` Nick Piggin
2010-02-22 17:37 ` Dmitry Monakhov
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=20100222103516.GA5131@atrey.karlin.mff.cuni.cz \
--to=jack@suse.cz \
--cc=dmonakhov@openvz.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).