From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Shapovalov Subject: [RFC] [PATCHv2 5/7] reiser4: txnmgr: call reiser4_post_write_back_hook() also for empty atoms. Date: Sun, 17 Aug 2014 20:26:33 +0400 Message-ID: <1408292795-1841-6-git-send-email-intelfx100@gmail.com> References: <1408292795-1841-1-git-send-email-intelfx100@gmail.com> Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=awv/EI7lqZ4wc6jS4Wgx1IMp7ckU4knaSPjjCjYgfxs=; b=nNUwD7vVO8YHcpSjcizUQgBUjuwKN2Et4XG72aORfgocQbKdddranC3fnl5BRCoWbD wNkn8zPmxxJaYKXST8q6gKZ1NUIq1PTyGEvIC7UwIV5z1WBB/3w1rIyxeK0YTIyDbg/5 dczNOuDpI/+CgIG3Obz+Xmk6ec3h+PYub1BAhDKJc/P4Vb0qc7JINylS4Gch/BayUCov AeOfQoqYYxArHFRKBURMlbOkcS33oPVN6i0SrEeNxtLZ6W3Dtd/Tf0FfKN0dcu8pAV1s A3MjVpgUw0jTrdb+clzseKhwgfdmxSP8+dctB9GTTWD2QFLiVHI2qhhxn5FeDv7b8oeB Ynkg== In-Reply-To: <1408292795-1841-1-git-send-email-intelfx100@gmail.com> Sender: reiserfs-devel-owner@vger.kernel.org List-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: reiserfs-devel@vger.kernel.org Cc: edward.shishkin@gmail.com, Ivan Shapovalov The atoms generated by reiser4_trim_fs(), despite being empty (zero capture_count), still have non-empty delete sets which have to be processed. Also the empty atom check has been moved after changing atom stage to ASTAGE_PRE_COMMIT, because reiser4_post_write_back_hook() requires atom to be unlocked. Signed-off-by: Ivan Shapovalov --- fs/reiser4/txnmgr.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fs/reiser4/txnmgr.c b/fs/reiser4/txnmgr.c index 2862940..2efdf85 100644 --- a/fs/reiser4/txnmgr.c +++ b/fs/reiser4/txnmgr.c @@ -1064,9 +1064,6 @@ static int commit_current_atom(long *nr_submitted, txn_atom ** atom) return RETERR(-E_REPEAT); } - if ((*atom)->capture_count == 0) - goto done; - /* Up to this point we have been flushing and after flush is called we return -E_REPEAT. Now we can commit. We cannot return -E_REPEAT at this point, commit should be successful. */ @@ -1074,6 +1071,14 @@ static int commit_current_atom(long *nr_submitted, txn_atom ** atom) ON_DEBUG(((*atom)->committer = current)); spin_unlock_atom(*atom); + if ((*atom)->capture_count == 0) { + /* Process the atom's delete set. + * Even if the atom has no captured nodes, the delete set may + * still be non-empty (see e. g. reiser4_trim_fs()). */ + reiser4_post_write_back_hook(); + goto done; + } + ret = current_atom_complete_writes(); if (ret) return ret; @@ -1100,8 +1105,8 @@ static int commit_current_atom(long *nr_submitted, txn_atom ** atom) reiser4_invalidate_list(ATOM_WB_LIST(*atom)); assert("zam-927", list_empty(&(*atom)->inodes)); +done: spin_lock_atom(*atom); - done: reiser4_atom_set_stage(*atom, ASTAGE_DONE); ON_DEBUG((*atom)->committer = NULL); -- 2.0.4