lkml.org 
[lkml]   [2012]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 51/73] union-mount: Create whiteout on rmdir() [ver #2]
    Date
    From: Valerie Aurora <vaurora@redhat.com>

    Whiteout a deleted directory in a union mounted file system.

    Original-author: Valerie Aurora <vaurora@redhat.com>
    Signed-off-by: David Howells <dhowells@redhat.com>
    ---

    fs/namei.c | 9 ++++-----
    1 files changed, 4 insertions(+), 5 deletions(-)

    diff --git a/fs/namei.c b/fs/namei.c
    index ce941ac..f9e0d68 100644
    --- a/fs/namei.c
    +++ b/fs/namei.c
    @@ -3228,11 +3228,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;
    @@ -3261,6 +3256,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);


    \
     
     \ /
      Last update: 2012-02-21 19:21    [W:0.025 / U:0.644 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site