From: Vivek Goyal <vgoyal@redhat.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: overlayfs <linux-unionfs@vger.kernel.org>,
Miklos Szeredi <miklos@szeredi.hu>,
Giuseppe Scrivano <gscrivan@redhat.com>,
Daniel J Walsh <dwalsh@redhat.com>
Subject: Re: [PATCH v7] overlayfs: Provide a mount option "volatile" to skip sync
Date: Tue, 1 Sep 2020 09:14:50 -0400 [thread overview]
Message-ID: <20200901131450.GA1218147@redhat.com> (raw)
In-Reply-To: <CAOQ4uxi6Hc4gNwCiogBG+FeeW-bAUd-ZsW2X=TPJ+6JZCbodVQ@mail.gmail.com>
On Tue, Sep 01, 2020 at 11:22:26AM +0300, Amir Goldstein wrote:
[..]
>
> > + int nr_elems = ARRAY_SIZE(dirty_path);
> > +
> > + err = 0;
> > + parent = ofs->workbasedir;
> > + dget(parent);
> > +
> > + for (i = 0; i < nr_elems; i++) {
> > + name = dirty_path[i];
> > + len = strlen(name);
> > + inode_lock_nested(parent->d_inode, I_MUTEX_PARENT);
> > + child = lookup_one_len(name, parent, len);
> > + if (IS_ERR(child)) {
> > + err = PTR_ERR(child);
> > + goto out_unlock;
> > + }
> > +
> > + if (!child->d_inode) {
> > + unsigned short ftype;
> > +
> > + ftype = (i == (nr_elems - 1)) ? S_IFREG : S_IFDIR;
> > + child = ovl_create_real(parent->d_inode, child,
> > + OVL_CATTR(ftype | 0));
> > + if (IS_ERR(child)) {
> > + err = PTR_ERR(child);
> > + goto out_unlock;
> > + }
> > + }
> > +
> > + inode_unlock(parent->d_inode);
> > + dput(parent);
> > + parent = child;
> > + child = NULL;
> > + }
> > +
> > + dput(parent);
> > + return err;
> > +
> > +out_unlock:
> > + inode_unlock(parent->d_inode);
> > + dput(parent);
> > + return err;
> > +}
> > +
>
> I think a helper ovl_test_create() along the lines of the helper found on
> my ovl-features branch could make this code a lot easier to follow.
> Note that the helper in that branch in not ready to be cherry-picked
> as is - it needs changes, so take it or leave it.
Hi Amir,
For now, I will like to stick with it. You can change it down then line
once ovl_test_create() is ready to be merged.
Vivek
next prev parent reply other threads:[~2020-09-01 14:12 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-31 18:15 [PATCH v7] overlayfs: Provide a mount option "volatile" to skip sync Vivek Goyal
2020-09-01 8:22 ` Amir Goldstein
2020-09-01 13:14 ` Vivek Goyal [this message]
2020-11-06 17:58 ` Sargun Dhillon
2020-11-06 19:00 ` Amir Goldstein
2020-11-06 19:20 ` Vivek Goyal
2020-11-09 17:22 ` Vivek Goyal
2020-11-09 17:25 ` Sargun Dhillon
2020-11-09 19:39 ` Amir Goldstein
2020-11-09 20:24 ` Vivek Goyal
2020-11-06 19:03 ` Vivek Goyal
2020-11-06 19:42 ` Giuseppe Scrivano
2020-11-07 9:35 ` Amir Goldstein
2020-11-07 11:52 ` Sargun Dhillon
2020-11-09 20:40 ` Vivek Goyal
2020-11-09 8:53 ` Giuseppe Scrivano
2020-11-09 10:10 ` Amir Goldstein
2020-11-09 16:36 ` Vivek Goyal
2020-11-09 17:09 ` Vivek Goyal
2020-11-09 17:20 ` Amir Goldstein
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=20200901131450.GA1218147@redhat.com \
--to=vgoyal@redhat.com \
--cc=amir73il@gmail.com \
--cc=dwalsh@redhat.com \
--cc=gscrivan@redhat.com \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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.