Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361854
b: refs/heads/master
c: 7ea600b
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Mar 26, 2013
1 parent 8b0c884 commit 985792b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06ae43f34bcc07a0b6be8bf78a1c895bcd12c839
refs/heads/master: 7ea600b5314529f9d1b9d6d3c41cb26fce6a7a4a
16 changes: 11 additions & 5 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2542,7 +2542,6 @@ static int prepend_path(const struct path *path,
bool slash = false;
int error = 0;

br_read_lock(&vfsmount_lock);
while (dentry != root->dentry || vfsmnt != root->mnt) {
struct dentry * parent;

Expand Down Expand Up @@ -2572,8 +2571,6 @@ static int prepend_path(const struct path *path,
if (!error && !slash)
error = prepend(buffer, buflen, "/", 1);

out:
br_read_unlock(&vfsmount_lock);
return error;

global_root:
Expand All @@ -2590,7 +2587,7 @@ static int prepend_path(const struct path *path,
error = prepend(buffer, buflen, "/", 1);
if (!error)
error = is_mounted(vfsmnt) ? 1 : 2;
goto out;
return error;
}

/**
Expand All @@ -2617,9 +2614,11 @@ char *__d_path(const struct path *path,
int error;

prepend(&res, &buflen, "\0", 1);
br_read_lock(&vfsmount_lock);
write_seqlock(&rename_lock);
error = prepend_path(path, root, &res, &buflen);
write_sequnlock(&rename_lock);
br_read_unlock(&vfsmount_lock);

if (error < 0)
return ERR_PTR(error);
Expand All @@ -2636,9 +2635,11 @@ char *d_absolute_path(const struct path *path,
int error;

prepend(&res, &buflen, "\0", 1);
br_read_lock(&vfsmount_lock);
write_seqlock(&rename_lock);
error = prepend_path(path, &root, &res, &buflen);
write_sequnlock(&rename_lock);
br_read_unlock(&vfsmount_lock);

if (error > 1)
error = -EINVAL;
Expand Down Expand Up @@ -2702,11 +2703,13 @@ char *d_path(const struct path *path, char *buf, int buflen)
return path->dentry->d_op->d_dname(path->dentry, buf, buflen);

get_fs_root(current->fs, &root);
br_read_lock(&vfsmount_lock);
write_seqlock(&rename_lock);
error = path_with_deleted(path, &root, &res, &buflen);
write_sequnlock(&rename_lock);
br_read_unlock(&vfsmount_lock);
if (error < 0)
res = ERR_PTR(error);
write_sequnlock(&rename_lock);
path_put(&root);
return res;
}
Expand Down Expand Up @@ -2830,6 +2833,7 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
get_fs_root_and_pwd(current->fs, &root, &pwd);

error = -ENOENT;
br_read_lock(&vfsmount_lock);
write_seqlock(&rename_lock);
if (!d_unlinked(pwd.dentry)) {
unsigned long len;
Expand All @@ -2839,6 +2843,7 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
prepend(&cwd, &buflen, "\0", 1);
error = prepend_path(&pwd, &root, &cwd, &buflen);
write_sequnlock(&rename_lock);
br_read_unlock(&vfsmount_lock);

if (error < 0)
goto out;
Expand All @@ -2859,6 +2864,7 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
}
} else {
write_sequnlock(&rename_lock);
br_read_unlock(&vfsmount_lock);
}

out:
Expand Down

0 comments on commit 985792b

Please sign in to comment.