diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2005-06-25 15:15:36 (GMT) |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2005-06-25 15:15:36 (GMT) |
commit | 9f993fe4634b39ca4404ba278053b03f360ec08a (patch) | |
tree | 36e62a3d384fa9c313cacd73b7aea086d7f74e82 /fs/ntfs/aops.c | |
parent | 3f2faef00c6af17542ea8672ed7d09367222b2d0 (diff) | |
download | linux-9f993fe4634b39ca4404ba278053b03f360ec08a.tar.xz |
NTFS: Fix a bug in address space operations error recovery code paths where
if the runlist was not mapped at all and a mapping error occured we
would leave the runlist locked on exit to the function so that the
next access to the same file would try to take the lock and deadlock.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to 'fs/ntfs/aops.c')
-rw-r--r-- | fs/ntfs/aops.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c index 24c46c2..3f43bfe6 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c @@ -264,7 +264,8 @@ lock_retry_remap: goto lock_retry_remap; rl = NULL; lcn = err; - } + } else if (!rl) + up_read(&ni->runlist.lock); /* Hard error, zero out region. */ bh->b_blocknr = -1; SetPageError(page); @@ -690,7 +691,8 @@ lock_retry_remap: goto lock_retry_remap; rl = NULL; lcn = err; - } + } else if (!rl) + up_read(&ni->runlist.lock); /* Failed to map the buffer, even after retrying. */ bh->b_blocknr = -1; ntfs_error(vol->sb, "Failed to write to inode 0x%lx, " @@ -965,8 +967,11 @@ lock_retry_remap: if (err2 == -ENOMEM) page_is_dirty = TRUE; lcn = err2; - } else + } else { err2 = -EIO; + if (!rl) + up_read(&ni->runlist.lock); + } /* Hard error. Abort writing this record. */ if (!err || err == -ENOMEM) err = err2; @@ -1660,6 +1665,8 @@ lock_retry_remap: "not supported yet. " "Sorry."); err = -EOPNOTSUPP; + if (!rl) + up_read(&ni->runlist.lock); goto err_out; } else if (!is_retry && lcn == LCN_RL_NOT_MAPPED) { @@ -1674,7 +1681,8 @@ lock_retry_remap: goto lock_retry_remap; rl = NULL; lcn = err; - } + } else if (!rl) + up_read(&ni->runlist.lock); /* * Failed to map the buffer, even after * retrying. |