From mboxrd@z Thu Jan 1 00:00:00 1970 From: Valerie Aurora Subject: [PATCH 54/74] union-mount: Create whiteout on rmdir() Date: Tue, 22 Mar 2011 19:04:45 -0700 Message-ID: <1300845905-14433-11-git-send-email-valerie.aurora@gmail.com> References: <1300845905-14433-1-git-send-email-valerie.aurora@gmail.com> Cc: viro@zeniv.linux.org.uk, Valerie Aurora , Valerie Aurora To: linux-fsdevel@vger.kernel.org, linux@vger.kernel.org Return-path: Received: from mail-yi0-f46.google.com ([209.85.218.46]:35943 "EHLO mail-yi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751707Ab1CWCFr (ORCPT ); Tue, 22 Mar 2011 22:05:47 -0400 In-Reply-To: <1300845905-14433-1-git-send-email-valerie.aurora@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: Valerie Aurora Whiteout a deleted directory in a union mounted file system. Signed-off-by: Valerie Aurora --- fs/namei.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 83f9c62..9c6803a 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2597,11 +2597,6 @@ static long do_rmdir(int dfd, const char __user *pathname) if (error) return error; - /* rmdir() on union mounts not implemented yet */ - error = -EINVAL; - if (IS_DIR_UNIONED(nd.path.dentry)) - goto exit1; - switch(nd.last_type) { case LAST_DOTDOT: error = -ENOTEMPTY; @@ -2626,6 +2621,10 @@ static long do_rmdir(int dfd, const char __user *pathname) error = security_path_rmdir(&nd.path, path.dentry); if (error) goto exit4; + if (IS_DIR_UNIONED(nd.path.dentry)) { + error = do_whiteout(&nd, &path, 1); + goto exit4; + } error = vfs_rmdir(nd.path.dentry->d_inode, path.dentry); exit4: mnt_drop_write(nd.path.mnt); -- 1.7.0.4