| From: Dan Williams <dan.j.williams@intel.com> |
| Subject: devdax: sparse fixes for xarray locking |
| Date: Fri, 14 Oct 2022 16:58:38 -0700 |
| |
| Now that the dax-mapping-entry code has moved to a common location take |
| the opportunity to fixup some long standing sparse warnings. In this case |
| annotate the manipulations of the Xarray lock: |
| |
| Link: https://lkml.kernel.org/r/166579191803.2236710.11651241811946564050.stgit@dwillia2-xfh.jf.intel.com |
| Fixes: |
| drivers/dax/mapping.c:216:13: sparse: warning: context imbalance in 'wait_entry_unlocked' - unexpected unlock |
| drivers/dax/mapping.c:953:9: sparse: warning: context imbalance in 'dax_writeback_one' - unexpected unlock |
| |
| Signed-off-by: Dan Williams <dan.j.williams@intel.com> |
| Reported-by: kernel test robot <lkp@intel.com> |
| Link: http://lore.kernel.org/r/202210091141.cHaQEuCs-lkp@intel.com |
| Cc: Alex Deucher <alexander.deucher@amd.com> |
| Cc: Alistair Popple <apopple@nvidia.com> |
| Cc: Ben Skeggs <bskeggs@redhat.com> |
| Cc: "Christian König" <christian.koenig@amd.com> |
| Cc: Christoph Hellwig <hch@lst.de> |
| Cc: Daniel Vetter <daniel@ffwll.ch> |
| Cc: "Darrick J. Wong" <djwong@kernel.org> |
| Cc: Dave Chinner <david@fromorbit.com> |
| Cc: David Airlie <airlied@linux.ie> |
| Cc: Felix Kuehling <Felix.Kuehling@amd.com> |
| Cc: Jan Kara <jack@suse.cz> |
| Cc: Jason Gunthorpe <jgg@nvidia.com> |
| Cc: Jerome Glisse <jglisse@redhat.com> |
| Cc: John Hubbard <jhubbard@nvidia.com> |
| Cc: Karol Herbst <kherbst@redhat.com> |
| Cc: Lyude Paul <lyude@redhat.com> |
| Cc: Matthew Wilcox <willy@infradead.org> |
| Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com> |
| Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
| --- |
| |
| drivers/dax/mapping.c | 4 ++-- |
| 1 file changed, 2 insertions(+), 2 deletions(-) |
| |
| --- a/drivers/dax/mapping.c~devdax-sparse-fixes-for-xarray-locking |
| +++ a/drivers/dax/mapping.c |
| @@ -213,7 +213,7 @@ static void *get_unlocked_entry(struct x |
| * (it's cycled in clear_inode() after removing the entries from i_pages) |
| * After we call xas_unlock_irq(), we cannot touch xas->xa. |
| */ |
| -static void wait_entry_unlocked(struct xa_state *xas, void *entry) |
| +static void wait_entry_unlocked(struct xa_state *xas, void *entry) __releases(xas) |
| { |
| struct wait_exceptional_entry_queue ewait; |
| wait_queue_head_t *wq; |
| @@ -910,7 +910,7 @@ out: |
| } |
| |
| int dax_writeback_one(struct xa_state *xas, struct dax_device *dax_dev, |
| - struct address_space *mapping, void *entry) |
| + struct address_space *mapping, void *entry) __must_hold(xas) |
| { |
| unsigned long pfn, index, count, end; |
| long ret = 0; |
| _ |