From: "zhangyi (F)" <yi.zhang@huawei.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: overlayfs <linux-unionfs@vger.kernel.org>,
fstests <fstests@vger.kernel.org>,
Miklos Szeredi <miklos@szeredi.hu>, Eryu Guan <eguan@redhat.com>,
Miao Xie <miaoxie@huawei.com>,
yangerkun@huawei.com
Subject: Re: [PATCH v3 6/6] fsck.overlay: add impure xattr check
Date: Fri, 29 Dec 2017 15:39:14 +0800 [thread overview]
Message-ID: <486b6a97-3b54-8a03-cbe5-bd43e277524e@huawei.com> (raw)
In-Reply-To: <CAOQ4uxgPMCfVDPvST43Sd755p=Pohk=nCbMTOG=v_1khd96BvA@mail.gmail.com>
On 2017/12/29 15:03, Amir Goldstein Wrote:
> On Fri, Dec 29, 2017 at 4:21 AM, zhangyi (F) <yi.zhang@huawei.com> wrote:
>> On 2017/12/28 21:18, Amir Goldstein Wrote:
>>> On Thu, Dec 28, 2017 at 1:40 PM, zhangyi (F) <yi.zhang@huawei.com> wrote:
>>>> An impure directory is a directory with "trusted.overlay.impure" xattr
>>>> valued 'y', which indicate that this directory may contain copy-uped
>>>> targets from lower layers. In oredr to prevent 'd_ino' change while
>>>> copy-up (it create a new inode in upper layer) in getdents(2), impure
>>>> xattr will be set in the parent directory, letting overlay filesystem
>>>> check and get d_ino from lower origin target to ensure consistent d_ino.
>>>>
>>>> There are three situations of setting impure xattr:
>>>> 1) Copyup lower target in a directory.
>>>> 2) Link an origined target (already copy-uped, have origin xattr) into
>>>> a directory.
>>>> 3) Rename an origined target (include merged subdirectories) into a
>>>> new directory.
>>>>
>>>> So, if a direcotry which contains several origined targets or redirect
>>>> directories, the impure xattr should be set. If not, fix this xattr.
>>>>
>>>> Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
>>>> ---
> [...]
>>>> case FTS_DEFAULT:
>>>> /* Check whiteouts */
>>>> - err = __check_entry(sctx, sop->whiteout);
>>>> - ret = (err) ? err : ret;
>>>> + ret = scan_check_entry(sop->whiteout, sctx);
>>>> + if (ret)
>>>> + goto out;
>>>> +
>>>> + /* Check origin */
>>>> + ret = scan_check_entry(sop->origin, sctx);
>>>> + if (ret)
>>>> + goto out;
>>>
>>> All the re-factoring of scan helpers and this additional origin check
>>> do not seem relevant to this change's subject (impure dir check).
>>>
>> Current origin check function only count origin targets in a directory
>> (this function can used for future check). Impure dir check use this
>> counts to distinguish this directory is impure or not, so this origin
>> check is necessary in this patch.
>>
>
> I see. Anyway, the cleaner the patch is, the easier it is to review it.
> A re-factoring patch that does not change behavior and declares this
> in commit message is easy to verify in review and a logic change
> patch that declares the logical change in commit message is easy to
> review. Mixing them both in a single patch without being able to declare
> that this is only a logical change not that this is only re-factoring makes
> reviewing harder.
>
> This is generally speaking. This patch was easy enough to review
> anyway, but other reviewers may not feel the same way.
>
Thanks for your advice, I can make it more clear and readable for the next posting.
Thanks,
Yi.
>
> .
>
prev parent reply other threads:[~2017-12-29 7:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-28 11:40 [PATCH v3 0/6] overlay: implement fsck.overlay utility zhangyi (F)
2017-12-28 11:40 ` [PATCH v3 1/6] overlay: implement fsck utility zhangyi (F)
2017-12-29 9:20 ` Amir Goldstein
2017-12-28 11:40 ` [PATCH v3 2/6] fsck.overlay: add -n -p and -y options zhangyi (F)
2017-12-28 13:52 ` Amir Goldstein
2017-12-28 11:40 ` [PATCH v3 3/6] fsck.overlay: encapsulate underlying directories options zhangyi (F)
2017-12-28 13:59 ` Amir Goldstein
2017-12-28 11:40 ` [PATCH v3 4/6] fsck.overlay: correct redirect xattr check zhangyi (F)
2017-12-28 14:22 ` Amir Goldstein
2017-12-29 3:23 ` zhangyi (F)
2017-12-29 9:32 ` Amir Goldstein
2017-12-29 10:25 ` zhangyi (F)
2017-12-28 11:40 ` [PATCH v3 5/6] fsck.overlay: fix lower target lookup zhangyi (F)
2017-12-28 11:40 ` [PATCH v3 6/6] fsck.overlay: add impure xattr check zhangyi (F)
2017-12-28 13:18 ` Amir Goldstein
2017-12-29 2:21 ` zhangyi (F)
2017-12-29 7:03 ` Amir Goldstein
2017-12-29 7:39 ` zhangyi (F) [this message]
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=486b6a97-3b54-8a03-cbe5-bd43e277524e@huawei.com \
--to=yi.zhang@huawei.com \
--cc=amir73il@gmail.com \
--cc=eguan@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miaoxie@huawei.com \
--cc=miklos@szeredi.hu \
--cc=yangerkun@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