Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
2b5adb1d
Commit
2b5adb1d
authored
May 10, 2002
by
Dave Kleikamp
Committed by
Linus Torvalds
May 10, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Prevent deadlock in JFS when flushing data during commit
This prevents a deadlock in JFS.
parent
2e48a176
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
12 deletions
+23
-12
fs/jfs/jfs_txnmgr.c
fs/jfs/jfs_txnmgr.c
+23
-12
No files found.
fs/jfs/jfs_txnmgr.c
View file @
2b5adb1d
...
...
@@ -1155,19 +1155,30 @@ int txCommit(tid_t tid, /* transaction identifier */
jfs_ip
=
JFS_IP
(
ip
);
/*
* BUGBUG - Should we call filemap_fdatawrite here instead
* of fsync_inode_data?
* If we do, we have a deadlock condition since we may end
* up recursively calling jfs_get_block with the IWRITELOCK
* held. We may be able to do away with IWRITELOCK while
* committing transactions and use i_sem instead.
* BUGBUG - This code has temporarily been removed. The
* intent is to ensure that any file data is written before
* the metadata is committed to the journal. This prevents
* uninitialized data from appearing in a file after the
* journal has been replayed. (The uninitialized data
* could be sensitive data removed by another user.)
*
* The problem now is that we are holding the IWRITELOCK
* on the inode, and calling filemap_fdatawrite on an
* unmapped page will cause a deadlock in jfs_get_block.
*
* The long term solution is to pare down the use of
* IWRITELOCK. We are currently holding it too long.
* We could also be smarter about which data pages need
* to be written before the transaction is committed and
* when we don't need to worry about it at all.
*
* if ((!S_ISDIR(ip->i_mode))
* && (tblk->flag & COMMIT_DELETE) == 0) {
* filemap_fdatawait(ip->i_mapping);
* filemap_fdatawrite(ip->i_mapping);
* filemap_fdatawait(ip->i_mapping);
* }
*/
if
((
!
S_ISDIR
(
ip
->
i_mode
))
&&
(
tblk
->
flag
&
COMMIT_DELETE
)
==
0
)
{
filemap_fdatawait
(
ip
->
i_mapping
);
filemap_fdatawrite
(
ip
->
i_mapping
);
filemap_fdatawait
(
ip
->
i_mapping
);
}
/*
* Mark inode as not dirty. It will still be on the dirty
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment