aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index c4c9072d810c..2b479de10a0a 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1782,6 +1782,7 @@ char *__d_path(const struct path *path, struct path *root,
1782 char * end = buffer+buflen; 1782 char * end = buffer+buflen;
1783 char * retval; 1783 char * retval;
1784 1784
1785 spin_lock(&vfsmount_lock);
1785 prepend(&end, &buflen, "\0", 1); 1786 prepend(&end, &buflen, "\0", 1);
1786 if (!IS_ROOT(dentry) && d_unhashed(dentry) && 1787 if (!IS_ROOT(dentry) && d_unhashed(dentry) &&
1787 (prepend(&end, &buflen, " (deleted)", 10) != 0)) 1788 (prepend(&end, &buflen, " (deleted)", 10) != 0))
@@ -1800,14 +1801,11 @@ char *__d_path(const struct path *path, struct path *root,
1800 break; 1801 break;
1801 if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) { 1802 if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
1802 /* Global root? */ 1803 /* Global root? */
1803 spin_lock(&vfsmount_lock);
1804 if (vfsmnt->mnt_parent == vfsmnt) { 1804 if (vfsmnt->mnt_parent == vfsmnt) {
1805 spin_unlock(&vfsmount_lock);
1806 goto global_root; 1805 goto global_root;
1807 } 1806 }
1808 dentry = vfsmnt->mnt_mountpoint; 1807 dentry = vfsmnt->mnt_mountpoint;
1809 vfsmnt = vfsmnt->mnt_parent; 1808 vfsmnt = vfsmnt->mnt_parent;
1810 spin_unlock(&vfsmount_lock);
1811 continue; 1809 continue;
1812 } 1810 }
1813 parent = dentry->d_parent; 1811 parent = dentry->d_parent;
@@ -1820,6 +1818,8 @@ char *__d_path(const struct path *path, struct path *root,
1820 dentry = parent; 1818 dentry = parent;
1821 } 1819 }
1822 1820
1821out:
1822 spin_unlock(&vfsmount_lock);
1823 return retval; 1823 return retval;
1824 1824
1825global_root: 1825global_root:
@@ -1829,9 +1829,11 @@ global_root:
1829 goto Elong; 1829 goto Elong;
1830 root->mnt = vfsmnt; 1830 root->mnt = vfsmnt;
1831 root->dentry = dentry; 1831 root->dentry = dentry;
1832 return retval; 1832 goto out;
1833
1833Elong: 1834Elong:
1834 return ERR_PTR(-ENAMETOOLONG); 1835 retval = ERR_PTR(-ENAMETOOLONG);
1836 goto out;
1835} 1837}
1836 1838
1837/** 1839/**