mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-08 23:55:14 +00:00
afs: Fix missing error handling in afs_write_end()
afs_write_end() is missing page unlock and put if afs_fill_page() fails. Reported-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
parent
440fbc3a8a
commit
afae457d87
1 changed files with 5 additions and 3 deletions
|
@ -198,7 +198,7 @@ int afs_write_end(struct file *file, struct address_space *mapping,
|
||||||
ret = afs_fill_page(vnode, key, pos + copied,
|
ret = afs_fill_page(vnode, key, pos + copied,
|
||||||
len - copied, page);
|
len - copied, page);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
goto out;
|
||||||
}
|
}
|
||||||
SetPageUptodate(page);
|
SetPageUptodate(page);
|
||||||
}
|
}
|
||||||
|
@ -206,10 +206,12 @@ int afs_write_end(struct file *file, struct address_space *mapping,
|
||||||
set_page_dirty(page);
|
set_page_dirty(page);
|
||||||
if (PageDirty(page))
|
if (PageDirty(page))
|
||||||
_debug("dirtied");
|
_debug("dirtied");
|
||||||
|
ret = copied;
|
||||||
|
|
||||||
|
out:
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
put_page(page);
|
put_page(page);
|
||||||
|
return ret;
|
||||||
return copied;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue