Skip to content

Commit

Permalink
fs/ntfs3: Unlock on error in attr_insert_range()
Browse files Browse the repository at this point in the history
This error path needs to call up_write(&ni->file.run_lock) and do some
other clean up before returning.

Fixes: aa30ecc ("fs/ntfs3: Fallocate (FALLOC_FL_INSERT_RANGE) implementation")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
  • Loading branch information
Dan Carpenter authored and Konstantin Komarov committed Jul 5, 2022
1 parent e66af07 commit 4838ec0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/ntfs3/attrib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2153,8 +2153,10 @@ int attr_insert_range(struct ntfs_inode *ni, u64 vbo, u64 bytes)
le_b = NULL;
attr_b = ni_find_attr(ni, NULL, &le_b, ATTR_DATA, NULL, 0, NULL,
&mi_b);
if (!attr_b)
return -ENOENT;
if (!attr_b) {
err = -ENOENT;
goto out;
}
if (!attr_b->non_res) {
err = -EINVAL;
goto out;
Expand Down

0 comments on commit 4838ec0

Please sign in to comment.