Artem Bityutskiy: > > Consider a scenario when 'vfs_link(dirA/fileA)' and > > 'vfs_unlink(dirA/fileA, dirB/fileB)' race. 'vfs_link()' does not > > lock 'dirA->i_mutex', so this is possible. Both of the functions ::: > Pushing this patch to ubifs-2.6.git, thanks. Ah, I am late. We need one minor correction. > @@ -528,6 +528,25 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir, > inode->i_nlink, dir->i_ino); > ubifs_assert(mutex_is_locked(&dir->i_mutex)); > ubifs_assert(mutex_is_locked(&inode->i_mutex)); > + > + /* > + * Return -ENOENT if we've raced with unlink and i_nlink is 0. Doing > + * otherwise has the potential to corrupt the orphan inode list. > + * > + * Indeed, consider a scenario when 'vfs_link(dirA/fileA)' and > + * 'vfs_unlink(dirA/fileA, dirB/fileB)' race. 'vfs_link()' does not This comment is confusing. Need to swich vfs_unlink and vfs_link. :-) J. R. Okajima -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html