* [PATCH] ovl: create all new directories opaque
@ 2016-11-21 13:04 Amir Goldstein
2016-11-21 13:38 ` Miklos Szeredi
0 siblings, 1 reply; 12+ messages in thread
From: Amir Goldstein @ 2016-11-21 13:04 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: linux-unionfs
There is really no good reason why not to make all
directories opaque from birth.
The benefit of making directiories opaque on creation
is that lookups can stop short when they reach the
original created directory.
The best case is overlay with N layers, performing
lookup for first level directory, which exists only in upper.
In that case, there will be only one lookup instead of N.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
fs/overlayfs/dir.c | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
index f1794af..cebcec0 100644
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -377,6 +377,8 @@ static int ovl_create_over_whiteout(struct dentry *dentry, struct inode *inode,
struct dentry *newdentry;
int err;
struct posix_acl *acl, *default_acl;
+ int is_dir = !hardlink && S_ISDIR(stat->mode);
+ int flags = RENAME_EXCHANGE;
if (WARN_ON(!workdir))
return -EROFS;
@@ -403,6 +405,10 @@ static int ovl_create_over_whiteout(struct dentry *dentry, struct inode *inode,
if (IS_ERR(upper))
goto out_dput;
+ /* mkdir can gets here with no upper whiteout - adjust exchange flag */
+ if (is_dir && d_is_negative(upper))
+ flags = 0;
+
err = ovl_create_real(wdir, newdentry, stat, link, hardlink, true);
if (err)
goto out_dput2;
@@ -434,23 +440,26 @@ static int ovl_create_over_whiteout(struct dentry *dentry, struct inode *inode,
goto out_cleanup;
}
- if (!hardlink && S_ISDIR(stat->mode)) {
+ if (is_dir) {
err = ovl_set_opaque(newdentry);
if (err)
goto out_cleanup;
- err = ovl_do_rename(wdir, newdentry, udir, upper,
- RENAME_EXCHANGE);
+ err = ovl_do_rename(wdir, newdentry, udir, upper, flags);
if (err)
goto out_cleanup;
- ovl_cleanup(wdir, upper);
+ if (!d_is_negative(upper))
+ ovl_cleanup(wdir, upper);
} else {
err = ovl_do_rename(wdir, newdentry, udir, upper, 0);
if (err)
goto out_cleanup;
}
ovl_instantiate(dentry, inode, newdentry, !!hardlink);
+ /* All directories are created opaque */
+ if (is_dir)
+ ovl_dentry_set_opaque(dentry, true);
newdentry = NULL;
out_dput2:
dput(upper);
@@ -477,6 +486,7 @@ static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,
int err;
const struct cred *old_cred;
struct cred *override_cred;
+ int is_dir = !hardlink && S_ISDIR(stat->mode);
err = ovl_copy_up(dentry->d_parent);
if (err)
@@ -500,7 +510,8 @@ static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,
put_cred(override_creds(override_cred));
put_cred(override_cred);
- if (!ovl_dentry_is_whiteout(dentry))
+ /* Always create new directories opaque */
+ if (!ovl_dentry_is_whiteout(dentry) && !is_dir)
err = ovl_create_upper(dentry, inode, stat, link,
hardlink);
else
@@ -1017,7 +1028,7 @@ static int ovl_rename(struct inode *olddir, struct dentry *old,
err = ovl_set_redirect(old, samedir);
if (err)
goto out_dput;
- } else if (!old_opaque && ovl_lower_positive(new)) {
+ } else if (!old_opaque) {
err = ovl_set_opaque(olddentry);
if (err)
goto out_dput;
@@ -1029,7 +1040,7 @@ static int ovl_rename(struct inode *olddir, struct dentry *old,
err = ovl_set_redirect(new, samedir);
if (err)
goto out_dput;
- } else if (!new_opaque && ovl_lower_positive(old)) {
+ } else if (!new_opaque) {
err = ovl_set_opaque(newdentry);
if (err)
goto out_dput;
--
2.7.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] ovl: create all new directories opaque
2016-11-21 13:04 [PATCH] ovl: create all new directories opaque Amir Goldstein
@ 2016-11-21 13:38 ` Miklos Szeredi
2016-11-21 13:45 ` Amir Goldstein
0 siblings, 1 reply; 12+ messages in thread
From: Miklos Szeredi @ 2016-11-21 13:38 UTC (permalink / raw)
To: Amir Goldstein; +Cc: linux-unionfs@vger.kernel.org
On Mon, Nov 21, 2016 at 2:04 PM, Amir Goldstein <amir73il@gmail.com> wrote:
> There is really no good reason why not to make all
> directories opaque from birth.
>
> The benefit of making directiories opaque on creation
> is that lookups can stop short when they reach the
> original created directory.
>
> The best case is overlay with N layers, performing
> lookup for first level directory, which exists only in upper.
> In that case, there will be only one lookup instead of N.
That's true for directories created in a merged dir. Directories
created in an opaque dir get no such advantage and creating the xattr
will consume space and time.
So this should at least be conditional on the state of the parent.
Thanks,
Miklos
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ovl: create all new directories opaque
2016-11-21 13:38 ` Miklos Szeredi
@ 2016-11-21 13:45 ` Amir Goldstein
2016-11-21 14:00 ` Miklos Szeredi
0 siblings, 1 reply; 12+ messages in thread
From: Amir Goldstein @ 2016-11-21 13:45 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: linux-unionfs@vger.kernel.org
On Mon, Nov 21, 2016 at 3:38 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Mon, Nov 21, 2016 at 2:04 PM, Amir Goldstein <amir73il@gmail.com> wrote:
>> There is really no good reason why not to make all
>> directories opaque from birth.
>>
>> The benefit of making directiories opaque on creation
>> is that lookups can stop short when they reach the
>> original created directory.
>>
>> The best case is overlay with N layers, performing
>> lookup for first level directory, which exists only in upper.
>> In that case, there will be only one lookup instead of N.
>
> That's true for directories created in a merged dir. Directories
> created in an opaque dir get no such advantage and creating the xattr
> will consume space and time.
>
> So this should at least be conditional on the state of the parent.
>
Will do.
But do you at least agree to unconditionally set dir opaque on rename?
There is really very little point is finding out if lower_is_positive()
Amir.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ovl: create all new directories opaque
2016-11-21 13:45 ` Amir Goldstein
@ 2016-11-21 14:00 ` Miklos Szeredi
2016-11-21 16:57 ` [PATCH v2] ovl: create directories inside merged parent opaque Amir Goldstein
0 siblings, 1 reply; 12+ messages in thread
From: Miklos Szeredi @ 2016-11-21 14:00 UTC (permalink / raw)
To: Amir Goldstein; +Cc: linux-unionfs@vger.kernel.org
On Mon, Nov 21, 2016 at 2:45 PM, Amir Goldstein <amir73il@gmail.com> wrote:
> On Mon, Nov 21, 2016 at 3:38 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
>> On Mon, Nov 21, 2016 at 2:04 PM, Amir Goldstein <amir73il@gmail.com> wrote:
>>> There is really no good reason why not to make all
>>> directories opaque from birth.
>>>
>>> The benefit of making directiories opaque on creation
>>> is that lookups can stop short when they reach the
>>> original created directory.
>>>
>>> The best case is overlay with N layers, performing
>>> lookup for first level directory, which exists only in upper.
>>> In that case, there will be only one lookup instead of N.
>>
>> That's true for directories created in a merged dir. Directories
>> created in an opaque dir get no such advantage and creating the xattr
>> will consume space and time.
>>
>> So this should at least be conditional on the state of the parent.
>>
>
> Will do.
> But do you at least agree to unconditionally set dir opaque on rename?
> There is really very little point is finding out if lower_is_positive()
Again: if dest parent is opaque, there's no need to set opaque on
moved dir. Otherwise (if dest parent is merged) it does make sense to
set opaque, regardless of whether it covers anything or not.
Thanks,
Miklos
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2] ovl: create directories inside merged parent opaque
2016-11-21 14:00 ` Miklos Szeredi
@ 2016-11-21 16:57 ` Amir Goldstein
2016-11-30 11:09 ` Miklos Szeredi
0 siblings, 1 reply; 12+ messages in thread
From: Amir Goldstein @ 2016-11-21 16:57 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: linux-unionfs
The benefit of making directories opaque on creation
is that lookups can stop short when they reach the
original created directory, instead of continue lookup
the entire depth of parent directory stack.
The best case is overlay with N layers, performing
lookup for first level directory, which exists only in upper.
In that case, there will be only one lookup instead of N.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
fs/overlayfs/dir.c | 51 ++++++++++++++++++++++++++++++++++-----------------
1 file changed, 34 insertions(+), 17 deletions(-)
diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
index f1794af..c393605 100644
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -128,6 +128,13 @@ int ovl_create_real(struct inode *dir, struct dentry *newdentry,
return err;
}
+static bool ovl_type_merge_or_lower(struct dentry *dentry)
+{
+ enum ovl_path_type type = ovl_path_type(dentry);
+
+ return OVL_TYPE_MERGE(type) || !OVL_TYPE_UPPER(type);
+}
+
static int ovl_set_opaque(struct dentry *upperdentry)
{
return ovl_do_setxattr(upperdentry, OVL_XATTR_OPAQUE, "y", 1, 0);
@@ -377,6 +384,8 @@ static int ovl_create_over_whiteout(struct dentry *dentry, struct inode *inode,
struct dentry *newdentry;
int err;
struct posix_acl *acl, *default_acl;
+ int is_dir = !hardlink && S_ISDIR(stat->mode);
+ int flags = RENAME_EXCHANGE;
if (WARN_ON(!workdir))
return -EROFS;
@@ -403,6 +412,10 @@ static int ovl_create_over_whiteout(struct dentry *dentry, struct inode *inode,
if (IS_ERR(upper))
goto out_dput;
+ /* mkdir can get here with no upper whiteout - adjust exchange flag */
+ if (is_dir && d_is_negative(upper))
+ flags = 0;
+
err = ovl_create_real(wdir, newdentry, stat, link, hardlink, true);
if (err)
goto out_dput2;
@@ -434,17 +447,19 @@ static int ovl_create_over_whiteout(struct dentry *dentry, struct inode *inode,
goto out_cleanup;
}
- if (!hardlink && S_ISDIR(stat->mode)) {
+ if (is_dir) {
err = ovl_set_opaque(newdentry);
if (err)
goto out_cleanup;
- err = ovl_do_rename(wdir, newdentry, udir, upper,
- RENAME_EXCHANGE);
+ err = ovl_do_rename(wdir, newdentry, udir, upper, flags);
if (err)
goto out_cleanup;
- ovl_cleanup(wdir, upper);
+ if (!d_is_negative(upper))
+ ovl_cleanup(wdir, upper);
+
+ ovl_dentry_set_opaque(dentry, true);
} else {
err = ovl_do_rename(wdir, newdentry, udir, upper, 0);
if (err)
@@ -477,6 +492,7 @@ static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,
int err;
const struct cred *old_cred;
struct cred *override_cred;
+ int is_dir = !hardlink && S_ISDIR(stat->mode);
err = ovl_copy_up(dentry->d_parent);
if (err)
@@ -500,12 +516,14 @@ static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,
put_cred(override_creds(override_cred));
put_cred(override_cred);
- if (!ovl_dentry_is_whiteout(dentry))
- err = ovl_create_upper(dentry, inode, stat, link,
- hardlink);
- else
+ /* Create new directories inside merged parent opaque */
+ if (ovl_dentry_is_whiteout(dentry) ||
+ (is_dir && ovl_type_merge_or_lower(dentry->d_parent)))
err = ovl_create_over_whiteout(dentry, inode, stat,
link, hardlink);
+ else
+ err = ovl_create_upper(dentry, inode, stat, link,
+ hardlink);
}
out_revert_creds:
revert_creds(old_cred);
@@ -782,13 +800,6 @@ static int ovl_rmdir(struct inode *dir, struct dentry *dentry)
return ovl_do_remove(dentry, true);
}
-static bool ovl_type_merge_or_lower(struct dentry *dentry)
-{
- enum ovl_path_type type = ovl_path_type(dentry);
-
- return OVL_TYPE_MERGE(type) || !OVL_TYPE_UPPER(type);
-}
-
static bool ovl_can_move(struct dentry *dentry)
{
return ovl_redirect_dir(dentry->d_sb) ||
@@ -1012,12 +1023,17 @@ static int ovl_rename(struct inode *olddir, struct dentry *old,
if (WARN_ON(olddentry->d_inode == newdentry->d_inode))
goto out_dput;
+ /*
+ * We need to make sure old/new dir is opaque if it is a pure upper
+ * that is being moved into a merged directory
+ */
if (is_dir) {
if (ovl_type_merge_or_lower(old)) {
err = ovl_set_redirect(old, samedir);
if (err)
goto out_dput;
- } else if (!old_opaque && ovl_lower_positive(new)) {
+ } else if (!old_opaque &&
+ ovl_type_merge_or_lower(new->d_parent)) {
err = ovl_set_opaque(olddentry);
if (err)
goto out_dput;
@@ -1029,7 +1045,8 @@ static int ovl_rename(struct inode *olddir, struct dentry *old,
err = ovl_set_redirect(new, samedir);
if (err)
goto out_dput;
- } else if (!new_opaque && ovl_lower_positive(old)) {
+ } else if (!new_opaque &&
+ ovl_type_merge_or_lower(old->d_parent)) {
err = ovl_set_opaque(newdentry);
if (err)
goto out_dput;
--
2.7.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2] ovl: create directories inside merged parent opaque
2016-11-21 16:57 ` [PATCH v2] ovl: create directories inside merged parent opaque Amir Goldstein
@ 2016-11-30 11:09 ` Miklos Szeredi
2016-11-30 12:58 ` Amir Goldstein
0 siblings, 1 reply; 12+ messages in thread
From: Miklos Szeredi @ 2016-11-30 11:09 UTC (permalink / raw)
To: Amir Goldstein; +Cc: linux-unionfs@vger.kernel.org
On Mon, Nov 21, 2016 at 5:57 PM, Amir Goldstein <amir73il@gmail.com> wrote:
> The benefit of making directories opaque on creation
> is that lookups can stop short when they reach the
> original created directory, instead of continue lookup
> the entire depth of parent directory stack.
>
> The best case is overlay with N layers, performing
> lookup for first level directory, which exists only in upper.
> In that case, there will be only one lookup instead of N.
I split this up, changed it around a bit and pushed the result to
overlayfs-next.
Thanks,
Miklos
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] ovl: create directories inside merged parent opaque
2016-11-30 11:09 ` Miklos Szeredi
@ 2016-11-30 12:58 ` Amir Goldstein
2016-11-30 14:19 ` Miklos Szeredi
0 siblings, 1 reply; 12+ messages in thread
From: Amir Goldstein @ 2016-11-30 12:58 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: linux-unionfs@vger.kernel.org
On Wed, Nov 30, 2016 at 1:09 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Mon, Nov 21, 2016 at 5:57 PM, Amir Goldstein <amir73il@gmail.com> wrote:
>> The benefit of making directories opaque on creation
>> is that lookups can stop short when they reach the
>> original created directory, instead of continue lookup
>> the entire depth of parent directory stack.
>>
>> The best case is overlay with N layers, performing
>> lookup for first level directory, which exists only in upper.
>> In that case, there will be only one lookup instead of N.
>
> I split this up, changed it around a bit and pushed the result to
> overlayfs-next.
>
Nice cleanup. FYI, you left me as sole S-O-B on the change.
Anyway, it passed my tests.
In case you are still interested, I rebase concurrent copy up
on top of overlay-rorw and pushed to branch #concurrent_copyup
on my github, with slightly improved commit message.
But I guess this merge window is crowded enough already and
I personally much rather see rorw merged than concurrent copy up.
Thanks,
Amir.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] ovl: create directories inside merged parent opaque
2016-11-30 12:58 ` Amir Goldstein
@ 2016-11-30 14:19 ` Miklos Szeredi
2016-11-30 14:49 ` Amir Goldstein
2016-11-30 16:06 ` Amir Goldstein
0 siblings, 2 replies; 12+ messages in thread
From: Miklos Szeredi @ 2016-11-30 14:19 UTC (permalink / raw)
To: Amir Goldstein; +Cc: linux-unionfs@vger.kernel.org
On Wed, Nov 30, 2016 at 1:58 PM, Amir Goldstein <amir73il@gmail.com> wrote:
> On Wed, Nov 30, 2016 at 1:09 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
>> On Mon, Nov 21, 2016 at 5:57 PM, Amir Goldstein <amir73il@gmail.com> wrote:
>>> The benefit of making directories opaque on creation
>>> is that lookups can stop short when they reach the
>>> original created directory, instead of continue lookup
>>> the entire depth of parent directory stack.
>>>
>>> The best case is overlay with N layers, performing
>>> lookup for first level directory, which exists only in upper.
>>> In that case, there will be only one lookup instead of N.
>>
>> I split this up, changed it around a bit and pushed the result to
>> overlayfs-next.
>>
>
> Nice cleanup. FYI, you left me as sole S-O-B on the change.
Okay, fixed.
> Anyway, it passed my tests.
>
> In case you are still interested, I rebase concurrent copy up
> on top of overlay-rorw and pushed to branch #concurrent_copyup
> on my github, with slightly improved commit message.
> But I guess this merge window is crowded enough already and
> I personally much rather see rorw merged than concurrent copy up.
My problem with the concurrent copy up is the complexity of locking
rules. Why not do some sort of overlay private lock here?
If a mutex is deemed too expensive, then just a bool "copying" in
ovl_entry and a waitq in ovl_fs in would do.
Thanks,
Miklos
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] ovl: create directories inside merged parent opaque
2016-11-30 14:19 ` Miklos Szeredi
@ 2016-11-30 14:49 ` Amir Goldstein
2016-11-30 15:09 ` Miklos Szeredi
2016-11-30 16:06 ` Amir Goldstein
1 sibling, 1 reply; 12+ messages in thread
From: Amir Goldstein @ 2016-11-30 14:49 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: linux-unionfs@vger.kernel.org
On Wed, Nov 30, 2016 at 4:19 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Wed, Nov 30, 2016 at 1:58 PM, Amir Goldstein <amir73il@gmail.com> wrote:
>>
>> In case you are still interested, I rebase concurrent copy up
>> on top of overlay-rorw and pushed to branch #concurrent_copyup
>> on my github, with slightly improved commit message.
>> But I guess this merge window is crowded enough already and
>> I personally much rather see rorw merged than concurrent copy up.
>
> My problem with the concurrent copy up is the complexity of locking
> rules. Why not do some sort of overlay private lock here?
>
> If a mutex is deemed too expensive, then just a bool "copying" in
> ovl_entry and a waitq in ovl_fs in would do.
>
I am quite certain that I was not able to explain my change properly
and that if you understood it you wouldn't call it complex.
If anything, it simplifies the locking rules.
Before my change, there is no clear definition of which locks are held
when calling ovl_copy_up(), but for all call sites besides
ovl_open_maybe_copy_up(), the overlay inode is already locked (by vfs).
My change only aligns the ovl_open_maybe_copy_up() case with the
rest of the code paths by taking the inode lock before calling ovl_copy_up()
and then the locking requirements for entry to ovl_copy_up() are
uniform across the code (and documented).
So why invent a new private lock when the overlay inode lock is perfectly
valid for the job?
After we have the inode lock in place, lock_rename() is taken when it is
needed for a specific operation (when either upperdir or workdir need to
be locked), so releasing it for data copy up is just a free gift.
Hope that I managed to clarify rather then confuse more.
Amir.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] ovl: create directories inside merged parent opaque
2016-11-30 14:49 ` Amir Goldstein
@ 2016-11-30 15:09 ` Miklos Szeredi
2016-11-30 15:57 ` Amir Goldstein
0 siblings, 1 reply; 12+ messages in thread
From: Miklos Szeredi @ 2016-11-30 15:09 UTC (permalink / raw)
To: Amir Goldstein; +Cc: linux-unionfs@vger.kernel.org
On Wed, Nov 30, 2016 at 3:49 PM, Amir Goldstein <amir73il@gmail.com> wrote:
> On Wed, Nov 30, 2016 at 4:19 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
>> On Wed, Nov 30, 2016 at 1:58 PM, Amir Goldstein <amir73il@gmail.com> wrote:
>>>
>>> In case you are still interested, I rebase concurrent copy up
>>> on top of overlay-rorw and pushed to branch #concurrent_copyup
>>> on my github, with slightly improved commit message.
>>> But I guess this merge window is crowded enough already and
>>> I personally much rather see rorw merged than concurrent copy up.
>>
>> My problem with the concurrent copy up is the complexity of locking
>> rules. Why not do some sort of overlay private lock here?
>>
>> If a mutex is deemed too expensive, then just a bool "copying" in
>> ovl_entry and a waitq in ovl_fs in would do.
>>
>
> I am quite certain that I was not able to explain my change properly
> and that if you understood it you wouldn't call it complex.
> If anything, it simplifies the locking rules.
>
> Before my change, there is no clear definition of which locks are held
> when calling ovl_copy_up(), but for all call sites besides
> ovl_open_maybe_copy_up(), the overlay inode is already locked (by vfs).
>
> My change only aligns the ovl_open_maybe_copy_up() case with the
> rest of the code paths by taking the inode lock before calling ovl_copy_up()
> and then the locking requirements for entry to ovl_copy_up() are
> uniform across the code (and documented).
>
> So why invent a new private lock when the overlay inode lock is perfectly
> valid for the job?
>
> After we have the inode lock in place, lock_rename() is taken when it is
> needed for a specific operation (when either upperdir or workdir need to
> be locked), so releasing it for data copy up is just a free gift.
>
> Hope that I managed to clarify rather then confuse more.
It is documented and easy to verify that inode lock is held by the VFS
for all but one case of copy_up(). However that one exception is not
documented and pretty hard to verify. I.e. if there's a call path
that results in d_real() being called with inode lock, it's going to
deadlock. And if that call path is hard to trigger, then testing
won't reveal this and the bug can remain undetected for a long time.
The current situation OTOH is perfectly fine, because copy up does not
rely on overlay inode being locked, so it simply does not matter if
the caller holds it or not.
Thanks,
Miklos
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] ovl: create directories inside merged parent opaque
2016-11-30 15:09 ` Miklos Szeredi
@ 2016-11-30 15:57 ` Amir Goldstein
0 siblings, 0 replies; 12+ messages in thread
From: Amir Goldstein @ 2016-11-30 15:57 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: linux-unionfs@vger.kernel.org
On Wed, Nov 30, 2016 at 5:09 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Wed, Nov 30, 2016 at 3:49 PM, Amir Goldstein <amir73il@gmail.com> wrote:
...
>>
>> So why invent a new private lock when the overlay inode lock is perfectly
>> valid for the job?
>>
>> After we have the inode lock in place, lock_rename() is taken when it is
>> needed for a specific operation (when either upperdir or workdir need to
>> be locked), so releasing it for data copy up is just a free gift.
>>
>> Hope that I managed to clarify rather then confuse more.
>
> It is documented and easy to verify that inode lock is held by the VFS
> for all but one case of copy_up(). However that one exception is not
> documented and pretty hard to verify. I.e. if there's a call path
> that results in d_real() being called with inode lock, it's going to
> deadlock. And if that call path is hard to trigger, then testing
> won't reveal this and the bug can remain undetected for a long time.
>
I see. I stand corrected. So I'll let you find the right candidate for
copy up lock.
Amir.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2] ovl: create directories inside merged parent opaque
2016-11-30 14:19 ` Miklos Szeredi
2016-11-30 14:49 ` Amir Goldstein
@ 2016-11-30 16:06 ` Amir Goldstein
1 sibling, 0 replies; 12+ messages in thread
From: Amir Goldstein @ 2016-11-30 16:06 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: linux-unionfs@vger.kernel.org
On Wed, Nov 30, 2016 at 4:19 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Wed, Nov 30, 2016 at 1:58 PM, Amir Goldstein <amir73il@gmail.com> wrote:
>>
>> Nice cleanup. FYI, you left me as sole S-O-B on the change.
>
> Okay, fixed.
>
Not pushed? yet?
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2016-11-30 16:06 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-21 13:04 [PATCH] ovl: create all new directories opaque Amir Goldstein
2016-11-21 13:38 ` Miklos Szeredi
2016-11-21 13:45 ` Amir Goldstein
2016-11-21 14:00 ` Miklos Szeredi
2016-11-21 16:57 ` [PATCH v2] ovl: create directories inside merged parent opaque Amir Goldstein
2016-11-30 11:09 ` Miklos Szeredi
2016-11-30 12:58 ` Amir Goldstein
2016-11-30 14:19 ` Miklos Szeredi
2016-11-30 14:49 ` Amir Goldstein
2016-11-30 15:09 ` Miklos Szeredi
2016-11-30 15:57 ` Amir Goldstein
2016-11-30 16:06 ` Amir Goldstein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox