xfs: fix up quotacheck buffer list error handling
authorBrian Foster <bfoster@redhat.com>
Fri, 21 Apr 2017 19:40:44 +0000 (12:40 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 25 Apr 2017 16:40:42 +0000 (09:40 -0700)
commit20e8a063786050083fe05b4f45be338c60b49126
tree9b3a3a226fad5b684035e9aed7f4f5f2c543c276
parent27af1bbf524459962d1477a38ac6e0b7f79aaecc
xfs: fix up quotacheck buffer list error handling

The quotacheck error handling of the delwri buffer list assumes the
resident buffers are locked and doesn't clear the _XBF_DELWRI_Q flag
on the buffers that are dequeued. This can lead to assert failures
on buffer release and possibly other locking problems.

Move this code to a delwri queue cancel helper function to
encapsulate the logic required to properly release buffers from a
delwri queue. Update the helper to clear the delwri queue flag and
call it from quotacheck.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_buf.c
fs/xfs/xfs_buf.h
fs/xfs/xfs_qm.c