summaryrefslogtreecommitdiffstats
path: root/geo-replication
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2018-11-11 22:53:07 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-11-29 15:34:57 +0000
commit65264180a386c7f10af5756175fdd8e096a7b115 (patch)
tree8f8686d05ead263a8a6b4d88afcf02f677361b8c /geo-replication
parent5bfb65ef69ef2e1095bc1d5ba71396c7dd167adc (diff)
leases: Fix incorrect inode_ref/unrefs
From testing & code-reading, found couple of places where we incorrectly unref the inode resulting in use_after_free crash or ref leaks. This patch addresses couple of them. a) When we try to grant the very first lease for a inode, inode_ref is taken in __add_lease. This ref should be active till all the leases granted to that inode are released (i.e, till lease_cnt > 0). In addition even after lease_cnt becomes '0', the inode should be active till all the blocked fops are resumed. Hence release this ref, after resuming all those fops. To avoid granting new leases while resuming those fops, defined a new boolean (blocked_fops_resuming) to flag it in the lease_ctx. b) 'new_lease_inode' which creates new lease_inode_entry and takes ref on inode, is used while adding that entry to client_list and recall_list. Use its counter function '__destroy_lease_inode' which does unref while removing those entries from those lists. c) inode ref is also taken when added to timer->data. Unref the same after processing timer->data. Change-Id: Ie77c78ff4a971e0d9a66178597fb34faf39205fb updates: bz#1651323 Signed-off-by: Soumya Koduri <skoduri@redhat.com> (cherry picked from commit b7aec05aa965202ab73120acf0da4c32fe0cf16c)
Diffstat (limited to 'geo-replication')
0 files changed, 0 insertions, 0 deletions