From: alex Date: Sat, 17 Sep 2005 22:48:46 +0000 (+0000) Subject: - protect i_nlink from concurrent changing X-Git-Tag: 1.4.10~483 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=4cefbf5f0781ad3d726c85fddfac97f5c53e7ebd;p=fs%2Flustre-release.git - protect i_nlink from concurrent changing --- diff --git a/lustre/smfs/dir.c b/lustre/smfs/dir.c index cc1fa3a..42724c6 100644 --- a/lustre/smfs/dir.c +++ b/lustre/smfs/dir.c @@ -656,7 +656,9 @@ static int smfs_rmdir(struct inode *dir, struct dentry *dentry) CWARN("Directory #%lu under rmdir has %i nlinks\n", inode->i_ino, inode->i_nlink); inode->i_nlink = 0; + lock_kernel(); dir->i_nlink--; + unlock_kernel(); post_smfs_inode(dir, cache_dir); post_smfs_inode(inode, cache_inode); //like vfs_rmdir is doing with inode