lkml.org 
[lkml]   [2013]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/11] vfs: check unlinked ancestors before mount
I'd probably just do this, and to hell with helper functions...

int d_set_mounted(struct dentry *dentry)
{
struct dentry *p;
int ret = 0;
write_seqlock(&rename_lock);
for (p = dentry; !IS_ROOT(p); p = p->d_parent) {
/* Need exclusion wrt. check_submounts_and_drop() */
spin_lock(&p->d_lock);
if (unlikely(d_unhashed(p))) {
spin_unlock(&p->d_lock);
ret = -ENOENT;
goto out;
}
spin_unlock(&p->d_lock);
}
spin_lock(&dentry->d_lock);
dentry->d_flags |= DCACHE_MOUNTED;
spin_unlock(&dentry->d_lock);
out:
write_sequnlock(&rename_lock);
return ret;
}


\
 
 \ /
  Last update: 2013-09-05 17:21    [W:1.367 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site