From: Miao Xie <miaoxie@huawei.com>
To: Wang Shilong <wshilong@ddn.com>,
Wang Shilong <wangshilong1991@gmail.com>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Cc: "tytso@mit.edu" <tytso@mit.edu>, Li Xi <lixi@ddn.com>,
"yi.zhang@huawei.com" <yi.zhang@huawei.com>,
"adilger@dilger.ca" <adilger@dilger.ca>,
Shuichi Ihara <sihara@ddn.com>
Subject: Re: [PATCH 1/2] ext4, project: expand inode extra size if possible
Date: Mon, 3 Jul 2017 10:49:29 +0800 [thread overview]
Message-ID: <fcc6383e-a6a4-e221-e58b-b5fa2ea52e25@huawei.com> (raw)
In-Reply-To: <3ED34739A4E85E4F894367D57617CDEFCA59786E@LAX-EX-MB2.datadirect.datadirectnet.com>
on 2017/7/3 at 9:16, Wang Shilong wrote:
>
> ________________________________________
> From: Miao Xie [miaoxie@huawei.com]
> Sent: Friday, June 30, 2017 16:48
> To: Wang Shilong; linux-ext4@vger.kernel.org
> Cc: tytso@mit.edu; Li Xi; yi.zhang@huawei.com; adilger@dilger.ca; Wang Shilong; Shuichi Ihara
> Subject: Re: [PATCH 1/2] ext4, project: expand inode extra size if possible
>
> on 2017/6/30 at 11:51, Wang Shilong wrote:
>> when upgrading from old format, try to set project id
>> to old file first time, it will return EOVERFLOW, but if
>> that file is dirtied(touch etc), changing project id will
> <...SNIP...>
>
> ext4_expand_extra_isize should be invoked after ext4_reserve_inode_write.
>
> And I think it is better to restructure ext4_expand_extra_isize by moving NO_EXPAND check,
> nojournal check and journal credits extend into it, and then we just if i_projid is in
>
> ---->I agreed we could move NO_EXPAND check, but i don't think it good idea to move journal
> credits extend to it, jbd2_extend_journal() might fail, and we'd better avoid it.
>
> For changing projectid, we could know how many credits before start transaction..
I found most check in set_projectid is the same as ext4_mark_inode_dirty, so I think it's better
to move those checks into ext4_expand_extra_isize to avoid the reduplicated code.
And I don't think jbd2_journal_extend's failure is a big problem, because we just invoke it once
most of the time, and even if we fail to extend the inode because of jbd2_journal_extend's failure,
the metadata is still safe, so it is unnecessary to change many codes in set_projectid, or
we will impact readability of the code.
>
> the inode or not, if not, invoke ext4_expand_extra_isize. (don't forget to do cleanup for
> ext4_mark_inode_dirty), And then we can remove many check in the above code.
>
>
> ---->what do you mean cleanup for ext4_mark_inode_dirty()? I supposed you mean don't
> call ext4_mark_iloc_dirty() if extend fail? i think that is expected, even inode extend fail,
> if ext4_mark_inode_dirty() is called, it means inode is dirtied already before we call the
> function.
I means if we move the checks into ext4_expand_extra_isize, we should do cleanup for ext4_mark_inode_dirty.
(ext4_mark_iloc_dirty() shoud be invoked even if extend fail, because we need update the on-disk inode)
Thanks
Miao
> Thanks,
> Shilong
>
>
> .
>
next prev parent reply other threads:[~2017-07-03 2:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 3:51 [PATCH 1/2] ext4, project: expand inode extra size if possible Wang Shilong
2017-06-30 8:48 ` Miao Xie
2017-06-30 9:54 ` Wang Shilong
2017-07-03 1:16 ` Wang Shilong
2017-07-03 2:49 ` Miao Xie [this message]
2017-07-03 2:58 ` Wang Shilong
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=fcc6383e-a6a4-e221-e58b-b5fa2ea52e25@huawei.com \
--to=miaoxie@huawei.com \
--cc=adilger@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=lixi@ddn.com \
--cc=sihara@ddn.com \
--cc=tytso@mit.edu \
--cc=wangshilong1991@gmail.com \
--cc=wshilong@ddn.com \
--cc=yi.zhang@huawei.com \
/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