xfs: only update mount/resv fields on success in __xfs_ag_resv_init
authorChristoph Hellwig <hch@lst.de>
Wed, 25 Jan 2017 15:49:34 +0000 (07:49 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Apr 2017 07:30:30 +0000 (09:30 +0200)
commit9be1c33d4a995d6369b94c7bb6ae0e8d18e7d658
tree16a18e5e8c2a3828e1e917318e664b3da65e05f8
parent8b08aec62c247db69f5e2a813912f65a46797fc2
xfs: only update mount/resv fields on success in __xfs_ag_resv_init

commit 4dfa2b84118fd6c95202ae87e62adf5000ccd4d0 upstream.

Try to reserve the blocks first and only then update the fields in
or hanging off the mount structure.  This way we can call __xfs_ag_resv_init
again after a previous failure.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/libxfs/xfs_ag_resv.c