diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2018-06-07 12:56:46 +0200 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2018-06-21 14:39:44 +0200 |
commit | 9e1a9ecd13b9bb421c88135b178577caf4d54f6a (patch) | |
tree | be518fb982b7f8f47c3ed3fa864772d4dd974985 /fs/gfs2/util.h | |
parent | gfs2: eliminate rs_inum and reduce the size of gfs2 inodes (diff) | |
download | linux-9e1a9ecd13b9bb421c88135b178577caf4d54f6a.tar.xz linux-9e1a9ecd13b9bb421c88135b178577caf4d54f6a.zip |
gfs2: Don't withdraw under a spin lock
In two places, the gfs2_io_error_bh macro is called while holding the
sd_ail_lock spin lock. This isn't allowed because gfs2_io_error_bh
withdraws the filesystem, which can sleep because it issues a uevent.
To fix that, add a gfs2_io_error_bh_wd macro that does withdraw the
filesystem and change gfs2_io_error_bh to not withdraw the filesystem.
In those places where the new gfs2_io_error_bh is used, withdraw the
filesystem after releasing sd_ail_lock.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Reviewed-by: Andrew Price <anprice@redhat.com>
Diffstat (limited to 'fs/gfs2/util.h')
-rw-r--r-- | fs/gfs2/util.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/gfs2/util.h b/fs/gfs2/util.h index 3926f95a6eb7..96ac4aba4738 100644 --- a/fs/gfs2/util.h +++ b/fs/gfs2/util.h @@ -136,11 +136,15 @@ int gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function, gfs2_io_error_i((sdp), __func__, __FILE__, __LINE__); -int gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh, - const char *function, char *file, unsigned int line); +void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh, + const char *function, char *file, unsigned int line, + bool withdraw); + +#define gfs2_io_error_bh_wd(sdp, bh) \ +gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, true); #define gfs2_io_error_bh(sdp, bh) \ -gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__); +gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, false); extern struct kmem_cache *gfs2_glock_cachep; |