All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Reshetova, Elena" <elena.reshetova@intel.com>
To: Kees Cook <keescook@chromium.org>, Christoph Hellwig <hch@infradead.org>
Cc: "darrick.wong@oracle.com" <darrick.wong@oracle.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
	Hans Liljestrand <ishkamiel@gmail.com>,
	"David Windsor" <dwindsor@gmail.com>
Subject: RE: [PATCH 3/5] fs, xfs: convert xlog_ticket.t_ref from atomic_t to refcount_t
Date: Thu, 9 Mar 2017 06:57:07 +0000	[thread overview]
Message-ID: <2236FBA76BA1254E88B949DDB74E612B41C569A2@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <CAGXu5jK3x+cPe4pccv0Q5W+9eDxu7n3Enih-TVRkysmwDwzGCA@mail.gmail.com>


> On Wed, Mar 8, 2017 at 7:50 AM, Christoph Hellwig <hch@infradead.org> wrote:
> >> -     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?
> 
> Yes, refcount_inc() will not increment from 0 and WARNs. It looks like
> xfs's ASSERT is also a warn (though with XFS-specific formatting), so
> perhaps the ASSERT could be dropped? IIUC, Elena's approach to these
> changes was to be conservative about removing the existing checks.

I am removing the existing WARNs now where they are 100% not needed, but leaving the ones like this ASSERT, 
because I am thinking that you might have test cases that are dependent on these ASSERTs with specific formatting and I don't want to break them. 
If you don't need them, I can remove them also. 

Best Regards,
Elena

> 
> -Kees
> 
> --
> Kees Cook
> Pixel Security

  reply	other threads:[~2017-03-09  6:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08  8:53 [PATCH 0/5] fs, xfs refcount conversions Elena Reshetova
2017-03-08  8:53 ` [PATCH 1/5] fs, xfs: convert xfs_bui_log_item.bui_refcount from atomic_t to refcount_t Elena Reshetova
2017-03-08  8:53 ` [PATCH 2/5] fs, xfs: convert xfs_efi_log_item.efi_refcount " Elena Reshetova
2017-03-08  8:53 ` [PATCH 3/5] fs, xfs: convert xlog_ticket.t_ref " Elena Reshetova
2017-03-08 15:50   ` Christoph Hellwig
2017-03-08 20:06     ` Kees Cook
2017-03-09  6:57       ` Reshetova, Elena [this message]
2017-03-08  8:53 ` [PATCH 4/5] fs, xfs: convert xfs_cui_log_item.cui_refcount " Elena Reshetova
2017-03-08  8:53 ` [PATCH 5/5] fs, xfs: convert xfs_rui_log_item.rui_refcount " Elena Reshetova
2017-04-20  8:11 ` [PATCH 0/5] fs, xfs refcount conversions Reshetova, Elena
2017-04-20 17:24   ` Darrick J. Wong
2017-04-20 22:04     ` Darrick J. Wong
2017-04-20 22:18       ` Kees Cook
  -- strict thread matches above, loose matches on Subject: below --
2017-11-29 11:37 [PATCH 0/5] v2 " Elena Reshetova
2017-11-29 11:38 ` [PATCH 3/5] fs, xfs: convert xlog_ticket.t_ref from atomic_t to refcount_t Elena Reshetova
2017-10-20 11:07 [PATCH 0/5] xfs refcount conversions Elena Reshetova
2017-10-20 11:07 ` [PATCH 3/5] fs, xfs: convert xlog_ticket.t_ref from atomic_t to refcount_t Elena Reshetova
2017-03-01  8:47 [PATCH 0/5] fs, xfs atomic_t to refcount_t conversions version 2 Elena Reshetova
2017-03-01  8:47 ` [PATCH 3/5] fs, xfs: convert xlog_ticket.t_ref from atomic_t to refcount_t Elena Reshetova

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2236FBA76BA1254E88B949DDB74E612B41C569A2@IRSMSX102.ger.corp.intel.com \
    --to=elena.reshetova@intel.com \
    --cc=darrick.wong@oracle.com \
    --cc=dwindsor@gmail.com \
    --cc=hch@infradead.org \
    --cc=ishkamiel@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.