From: Dmitry Monakhov <dmonakhov@openvz.org>
To: Ted Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org, achender@linux.vnet.ibm.com
Subject: Re: [PATCH 2/6] ext4: move inode indepth shrink logic to didicated function
Date: Fri, 28 Oct 2011 14:47:40 +0400 [thread overview]
Message-ID: <87mxclz92r.fsf@dmbot.sw.ru> (raw)
In-Reply-To: <20111025080135.GA31921@thunk.org>
On Tue, 25 Oct 2011 04:01:35 -0400, "Ted Ts'o" <tytso@mit.edu> wrote:
> On Fri, Oct 21, 2011 at 01:08:55AM +0400, Dmitry Monakhov wrote:
> > - add ext4_ext_try_shrink helper
> > - ext4_mark_inode_dirty() called externally in order to allow
> > caller to butch several inode updates in to one mark_dirty call.
> >
> > Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
>
> This patch is broken in two ways:
>
> 1) It drops the absolutely necessary calls to ext4_ext_get_access()
> and ext4_ext_dirty(). If you don't do this you will get file
> system corruptions.
You almost caught me.. When i read this comment for the first time, i've
thought that you right, and this patch is crap. Patch was written two
month ago so i almost forget exact details. But still it was strange
because whole series was tested very hard, and never saw any corruption,
or complains. From other point of view usually meta data modification
w/o prior get_write_access call result in complain from JBD thread about dirty
bufs in transaction.c:warn_dirty_buffer(). This never happen in my case.
Answer is simple: ext4_ext_get_access(path[0]) is noop in case of inode body
because it has no bh attached. And ext4_ext_dirty() turns in to
ext4_mark_inode_dirty(). That's why patch is correct..
>
> 2) Some of the callers to the new ext4_ext_try_shrink() helper depends
> on it return 0 or 1 depending on whether the tree was shrunk, but
> others assumed that it would return an error code. Which is OK,
> since the error codes should be negative, but that means it's
> critical that the callers check to see whether return code is
> really an error before returning it.
and {0:1} retcode is sufficient. Situation will change after flexible
tree reduction appear, but this happens in perfect future.
>
> Since this is just a cleanup, I'm going to skip this for now. Dmitry,
> could you fix this up and resubmit? Thanks!!
>
> - Ted
next prev parent reply other threads:[~2011-10-28 10:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-20 21:08 [PATCH 0/6] ext4: cleanups and regression fixes for grow/shrink logic V2 Dmitry Monakhov
2011-10-20 21:08 ` [PATCH 1/6] ext4: cleanup ext4_ext_grow_indepth code Dmitry Monakhov
2011-10-22 5:27 ` Ted Ts'o
2011-10-20 21:08 ` [PATCH 2/6] ext4: move inode indepth shrink logic to didicated function Dmitry Monakhov
2011-10-25 8:01 ` Ted Ts'o
2011-10-28 10:47 ` Dmitry Monakhov [this message]
2011-10-20 21:08 ` [PATCH 3/6] ext4: Do not clear EOFBLOCKS_FL too soon Dmitry Monakhov
2011-10-25 8:18 ` Ted Ts'o
2011-10-25 11:57 ` Dmitry Monakhov
2011-10-20 21:08 ` [PATCH 4/6] ext4: remove messy logic from ext4_ext_rm_leaf Dmitry Monakhov
2011-10-25 11:44 ` Ted Ts'o
2011-10-20 21:08 ` [PATCH 5/6] ext4: fix punch_hole extend handler Dmitry Monakhov
2011-10-25 12:05 ` Ted Ts'o
2011-10-25 12:35 ` Dmitry Monakhov
2011-10-26 13:38 ` Ted Ts'o
2011-10-20 21:08 ` [PATCH 6/6] ext4: update EOFBLOCKS flag on fallocate properly Dmitry Monakhov
2011-10-25 12:22 ` Ted Ts'o
2011-10-28 21:40 ` Andreas Dilger
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=87mxclz92r.fsf@dmbot.sw.ru \
--to=dmonakhov@openvz.org \
--cc=achender@linux.vnet.ibm.com \
--cc=linux-ext4@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.