Whamcloud - gitweb
- protect i_nlink from concurrent changing
authoralex <alex>
Sat, 17 Sep 2005 22:48:46 +0000 (22:48 +0000)
committeralex <alex>
Sat, 17 Sep 2005 22:48:46 +0000 (22:48 +0000)
lustre/smfs/dir.c

index cc1fa3a..42724c6 100644 (file)
@@ -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