Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1d00b2d authored by Taesoo Kim's avatar Taesoo Kim Committed by Ilya Dryomov
Browse files

ceph: properly release page upon error



When ceph_update_writeable_page fails (including -EAGAIN), it
unlocks (w/ unlock_page) the page but does not 'release'
(w/ page_cache_release) properly.

Upon error, properly set *pagep to NULL, indicating an error.

Signed-off-by: default avatarTaesoo Kim <tsgatesv@gmail.com>
Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
parent 1fe48023
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1146,6 +1146,10 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
		     inode, page, (int)pos, (int)len);

		r = ceph_update_writeable_page(file, pos, len, page);
		if (r < 0)
			page_cache_release(page);
		else
			*pagep = page;
	} while (r == -EAGAIN);

	return r;