Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1595549
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/5] fs, xfs: convert xlog_ticket.t_ref from atomic_t to refcount_t |
| Date | 2017-03-08 23:10 +0100 |
| Message-ID | <tiRWp-4gI-9@gated-at.bofh.it> (permalink) |
| References | <tiFBU-3WM-7@gated-at.bofh.it> <tiI6K-5Wo-13@gated-at.bofh.it> <tiMam-bQ-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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. -Kees -- Kees Cook Pixel Security
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/5] fs, xfs refcount conversions Elena Reshetova <elena.reshetova@intel.com> - 2017-03-08 10:00 +0100
[PATCH 5/5] fs, xfs: convert xfs_rui_log_item.rui_refcount from atomic_t to refcount_t Elena Reshetova <elena.reshetova@intel.com> - 2017-03-08 10:00 +0100
[PATCH 1/5] fs, xfs: convert xfs_bui_log_item.bui_refcount from atomic_t to refcount_t Elena Reshetova <elena.reshetova@intel.com> - 2017-03-08 10:00 +0100
[PATCH 2/5] fs, xfs: convert xfs_efi_log_item.efi_refcount from atomic_t to refcount_t Elena Reshetova <elena.reshetova@intel.com> - 2017-03-08 10:00 +0100
[PATCH 3/5] fs, xfs: convert xlog_ticket.t_ref from atomic_t to refcount_t Elena Reshetova <elena.reshetova@intel.com> - 2017-03-08 12:40 +0100
Re: [PATCH 3/5] fs, xfs: convert xlog_ticket.t_ref from atomic_t to refcount_t Christoph Hellwig <hch@infradead.org> - 2017-03-08 17:00 +0100
Re: [PATCH 3/5] fs, xfs: convert xlog_ticket.t_ref from atomic_t to refcount_t Kees Cook <keescook@chromium.org> - 2017-03-08 23:10 +0100
RE: [PATCH 3/5] fs, xfs: convert xlog_ticket.t_ref from atomic_t to refcount_t "Reshetova, Elena" <elena.reshetova@intel.com> - 2017-03-09 08:00 +0100
[PATCH 4/5] fs, xfs: convert xfs_cui_log_item.cui_refcount from atomic_t to refcount_t Elena Reshetova <elena.reshetova@intel.com> - 2017-03-08 15:40 +0100
csiph-web