From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753686AbdCHPvd (ORCPT ); Wed, 8 Mar 2017 10:51:33 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:51167 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753120AbdCHPvb (ORCPT ); Wed, 8 Mar 2017 10:51:31 -0500 Date: Wed, 8 Mar 2017 07:50:59 -0800 From: Christoph Hellwig To: Elena Reshetova Cc: darrick.wong@oracle.com, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, Hans Liljestrand , Kees Cook , David Windsor Subject: Re: [PATCH 3/5] fs, xfs: convert xlog_ticket.t_ref from atomic_t to refcount_t Message-ID: <20170308155059.GA4353@infradead.org> References: <1488963219-11709-1-git-send-email-elena.reshetova@intel.com> <1488963219-11709-4-git-send-email-elena.reshetova@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1488963219-11709-4-git-send-email-elena.reshetova@intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > - ASSERT(atomic_read(&ticket->t_ref) > 0); > - atomic_inc(&ticket->t_ref); > + ASSERT(refcount_read(&ticket->t_ref) > 0); > + refcount_inc(&ticket->t_ref); With strict refcount semantics refcount_inc should check that the count is larger than 0, otherwise we'd need to use recount_inc_not_zero or whatever you're going to call it. Is that something the recount code does / could do?