From: Jordi Pujol Subject: Re: overlayfs v8 problems with whiteout links Date: Sun, 24 Apr 2011 20:08:53 +0200 Message-ID: <201104242008.53293.jordipujolp@gmail.com> References: <201104221043.43380.jordipujolp@gmail.com> <201104231443.39557.jordipujolp@gmail.com> <201104231651.10627.jordipujolp@gmail.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_1cGtNTiaf0Xd/3K" Cc: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:39490 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753120Ab1DXSI6 (ORCPT ); Sun, 24 Apr 2011 14:08:58 -0400 Received: by wya21 with SMTP id 21so1208551wya.19 for ; Sun, 24 Apr 2011 11:08:57 -0700 (PDT) In-Reply-To: <201104231651.10627.jordipujolp@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --Boundary-00=_1cGtNTiaf0Xd/3K Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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 --Boundary-00=_1cGtNTiaf0Xd/3K Content-Type: text/x-patch; charset="UTF-8"; name="dir.c-lower-dentry.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dir.c-lower-dentry.patch" --- 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); --Boundary-00=_1cGtNTiaf0Xd/3K--