Details
-
Technical task
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
9223372036854775807
Description
When benchmark with IOR, we found the following deadlock:
memfs_file_write_iter() { .... down_read(&wbci->wbci_rw_sem); // lock 1 if (wbc_inode_data_caching(wbci)) { inode_lock(inode); // lock 2 rc = generic_write_checks(iocb, iter); if (rc > 0) rc = __generic_file_write_iter(iocb, iter); inode_unlock(inode); .... } up_read(&wbci->wbci_rw_sem); .... } memfs_write_begin(...) { rc = memfs_write_getpage(inode, index, pagep); if (rc == -ENOSPC) { int rc2; // need to call inode_unlock(inode); up_read(&wbci->wbci_rw_sem); rc2 = wbc_make_data_commit(file->f_path.dentry); down_read(&wbci->wbci_rw_sem); // need to call inode_lock(inode); if (rc2 < 0) rc = rc2; }