diff options
Diffstat (limited to 'drivers/block/drbd/drbd_int.h')
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 356a6e5b4415..79c69ebb0653 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -832,6 +832,7 @@ enum { | |||
832 | BITMAP_IO_QUEUED, /* Started bitmap IO */ | 832 | BITMAP_IO_QUEUED, /* Started bitmap IO */ |
833 | GO_DISKLESS, /* Disk is being detached, on io-error or admin request. */ | 833 | GO_DISKLESS, /* Disk is being detached, on io-error or admin request. */ |
834 | WAS_IO_ERROR, /* Local disk failed returned IO error */ | 834 | WAS_IO_ERROR, /* Local disk failed returned IO error */ |
835 | FORCE_DETACH, /* Force-detach from local disk, aborting any pending local IO */ | ||
835 | RESYNC_AFTER_NEG, /* Resync after online grow after the attach&negotiate finished. */ | 836 | RESYNC_AFTER_NEG, /* Resync after online grow after the attach&negotiate finished. */ |
836 | NET_CONGESTED, /* The data socket is congested */ | 837 | NET_CONGESTED, /* The data socket is congested */ |
837 | 838 | ||
@@ -1838,12 +1839,20 @@ static inline int drbd_request_state(struct drbd_conf *mdev, | |||
1838 | return _drbd_request_state(mdev, mask, val, CS_VERBOSE + CS_ORDERED); | 1839 | return _drbd_request_state(mdev, mask, val, CS_VERBOSE + CS_ORDERED); |
1839 | } | 1840 | } |
1840 | 1841 | ||
1842 | enum drbd_force_detach_flags { | ||
1843 | DRBD_IO_ERROR, | ||
1844 | DRBD_META_IO_ERROR, | ||
1845 | DRBD_FORCE_DETACH, | ||
1846 | }; | ||
1847 | |||
1841 | #define __drbd_chk_io_error(m,f) __drbd_chk_io_error_(m,f, __func__) | 1848 | #define __drbd_chk_io_error(m,f) __drbd_chk_io_error_(m,f, __func__) |
1842 | static inline void __drbd_chk_io_error_(struct drbd_conf *mdev, int forcedetach, const char *where) | 1849 | static inline void __drbd_chk_io_error_(struct drbd_conf *mdev, |
1850 | enum drbd_force_detach_flags forcedetach, | ||
1851 | const char *where) | ||
1843 | { | 1852 | { |
1844 | switch (mdev->ldev->dc.on_io_error) { | 1853 | switch (mdev->ldev->dc.on_io_error) { |
1845 | case EP_PASS_ON: | 1854 | case EP_PASS_ON: |
1846 | if (!forcedetach) { | 1855 | if (forcedetach == DRBD_IO_ERROR) { |
1847 | if (__ratelimit(&drbd_ratelimit_state)) | 1856 | if (__ratelimit(&drbd_ratelimit_state)) |
1848 | dev_err(DEV, "Local IO failed in %s.\n", where); | 1857 | dev_err(DEV, "Local IO failed in %s.\n", where); |
1849 | if (mdev->state.disk > D_INCONSISTENT) | 1858 | if (mdev->state.disk > D_INCONSISTENT) |
@@ -1854,6 +1863,8 @@ static inline void __drbd_chk_io_error_(struct drbd_conf *mdev, int forcedetach, | |||
1854 | case EP_DETACH: | 1863 | case EP_DETACH: |
1855 | case EP_CALL_HELPER: | 1864 | case EP_CALL_HELPER: |
1856 | set_bit(WAS_IO_ERROR, &mdev->flags); | 1865 | set_bit(WAS_IO_ERROR, &mdev->flags); |
1866 | if (forcedetach == DRBD_FORCE_DETACH) | ||
1867 | set_bit(FORCE_DETACH, &mdev->flags); | ||
1857 | if (mdev->state.disk > D_FAILED) { | 1868 | if (mdev->state.disk > D_FAILED) { |
1858 | _drbd_set_state(_NS(mdev, disk, D_FAILED), CS_HARD, NULL); | 1869 | _drbd_set_state(_NS(mdev, disk, D_FAILED), CS_HARD, NULL); |
1859 | dev_err(DEV, | 1870 | dev_err(DEV, |
@@ -1873,7 +1884,7 @@ static inline void __drbd_chk_io_error_(struct drbd_conf *mdev, int forcedetach, | |||
1873 | */ | 1884 | */ |
1874 | #define drbd_chk_io_error(m,e,f) drbd_chk_io_error_(m,e,f, __func__) | 1885 | #define drbd_chk_io_error(m,e,f) drbd_chk_io_error_(m,e,f, __func__) |
1875 | static inline void drbd_chk_io_error_(struct drbd_conf *mdev, | 1886 | static inline void drbd_chk_io_error_(struct drbd_conf *mdev, |
1876 | int error, int forcedetach, const char *where) | 1887 | int error, enum drbd_force_detach_flags forcedetach, const char *where) |
1877 | { | 1888 | { |
1878 | if (error) { | 1889 | if (error) { |
1879 | unsigned long flags; | 1890 | unsigned long flags; |