linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jordi Pujol <jordipujolp@gmail.com>
To: linux-fsdevel@vger.kernel.org
Cc: Miklos Szeredi <miklos@szeredi.hu>
Subject: Re: overlayfs v8 problems with whiteout links
Date: Sun, 24 Apr 2011 20:08:53 +0200	[thread overview]
Message-ID: <201104242008.53293.jordipujolp@gmail.com> (raw)
In-Reply-To: <201104231651.10627.jordipujolp@gmail.com>

[-- Attachment #1: Type: Text/Plain, Size: 421 bytes --]

Hello,

I have solved this checking if the lower dentry exists when calling 
ovl_whiteout in ovl_do_remove and ovl_rename,
also added in ovl_whiteout a check for existance of lower dentry and a debug 
message, as it was already planned as a TODO task in the source code.

by now it works, even the debug message not appears,

Thanks,

Jordi Pujol

Live never ending Tale
GNU/Linux Live forever!
http://livenet.selfip.com

[-- Attachment #2: dir.c-lower-dentry.patch --]
[-- Type: text/x-patch, Size: 1217 bytes --]

--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -33,7 +33,14 @@ static int ovl_whiteout(struct dentry *u
 	const struct cred *old_cred;
 	struct cred *override_cred;
 
-	/* FIXME: recheck lower dentry to see if whiteout is really needed */
+	err = 0;
+	/* recheck lower dentry to see if whiteout is really needed */
+	/* dont consider this an error */
+	if (!ovl_dentry_lower(dentry)) {
+		printk(KERN_DEBUG "overlayfs: DEBUG - no lower dentry to whiteout '%s'\n",
+		       dentry->d_name.name);
+		return 0;
+	}
 
 	err = -ENOMEM;
 	override_cred = prepare_creds();
@@ -376,7 +383,8 @@ static int ovl_do_remove(struct dentry *
 		ovl_dentry_version_inc(dentry->d_parent);
 	}
 
-	if (type != OVL_PATH_UPPER || ovl_dentry_is_opaque(dentry))
+	if ((type != OVL_PATH_UPPER || ovl_dentry_is_opaque(dentry))
+	&& ovl_dentry_lower(dentry))
 		err = ovl_whiteout(upperdir, dentry);
 
 	/*
@@ -554,7 +562,8 @@ static int ovl_rename(struct inode *oldd
 		goto out_dput;
 	}
 
-	if (old_type != OVL_PATH_UPPER || old_opaque)
+	if ((old_type != OVL_PATH_UPPER || old_opaque)
+	&& ovl_dentry_lower(old))
 		err = ovl_whiteout(old_upperdir, old);
 	if (is_dir && old_opaque && !new_opaque)
 		ovl_remove_opaque(olddentry);

  reply	other threads:[~2011-04-24 18:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22  8:43 overlayfs v8 problems with whiteout links Jordi Pujol
2011-04-23 12:43 ` Jordi Pujol
2011-04-23 14:51   ` Jordi Pujol
2011-04-24 18:08     ` Jordi Pujol [this message]
2011-04-26 15:50       ` Miklos Szeredi
2011-04-27  7:57         ` Jordi Pujol
2011-04-27 11:41           ` Miklos Szeredi
2011-04-27 13:30             ` Jordi Pujol
2011-04-27 14:50               ` Jordi Pujol
2011-04-27 18:52                 ` Miklos Szeredi
2011-04-26 15:34     ` Miklos Szeredi
2011-04-27  9:36       ` Jordi Pujol

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=201104242008.53293.jordipujolp@gmail.com \
    --to=jordipujolp@gmail.com \
    --cc=linux-fsdevel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).