From: green Date: Wed, 27 Apr 2005 08:22:11 +0000 (+0000) Subject: b=5907 X-Git-Tag: v1_7_100~1^25~8^2~192 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=d2a0df6f588da4a1737775fffaed5c76bbbb89da;p=fs%2Flustre-release.git b=5907 r=adilger Do not allow to remove mountpoints on lustre --- diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 430eb17..f9beaec 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -684,11 +684,22 @@ static int ll_rmdir_raw(struct nameidata *nd) struct inode *dir = nd->dentry->d_inode; struct ptlrpc_request *request = NULL; struct mdc_op_data op_data; + struct dentry *dentry; int rc; ENTRY; CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p)\n", nd->last.len, nd->last.name, dir->i_ino, dir->i_generation, dir); + /* Check if we have something mounted at the dir we are going to delete + * In such a case there would always be dentry present. */ + dentry = d_lookup(nd->dentry, &nd->last); + if (dentry) { + int mounted = d_mountpoint(dentry); + dput(dentry); + if (mounted) + RETURN(-EBUSY); + } + ll_prepare_mdc_op_data(&op_data, dir, NULL, nd->last.name, nd->last.len, S_IFDIR); rc = mdc_unlink(ll_i2sbi(dir)->ll_mdc_exp, &op_data, &request);