Commit 5d3cc36b authored by Viacheslav Dubeyko's avatar Viacheslav Dubeyko Committed by Ilya Dryomov
Browse files

ceph: fix a buffer leak in __ceph_setxattr()



The old_blob in __ceph_setxattr() can store
ci->i_xattrs.prealloc_blob value during the retry.
However, it is never called the ceph_buffer_put()
for the old_blob object. This patch fixes the issue of
the buffer leak.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarViacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Reviewed-by: default avatarAlex Markuze <amarkuze@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 596f9129
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1294,6 +1294,7 @@ int __ceph_setxattr(struct inode *inode, const char *name,

do_sync:
	spin_unlock(&ci->i_ceph_lock);
	ceph_buffer_put(old_blob);
do_sync_unlocked:
	if (lock_snap_rwsem)
		up_read(&mdsc->snap_rwsem);