diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2013-04-10 10:26:55 +0100 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2013-04-10 10:26:55 +0100 |
commit | 81ffbf654f0cfeeb44e69832b3d301958a4108d8 (patch) | |
tree | 7c9c2d1c91dc2f696ea7cd0db25a28987195fcf6 /fs/gfs2/glops.c | |
parent | 16ca9412d8018188bddda29c3fee88471b94e3cb (diff) | |
download | blackbird-op-linux-81ffbf654f0cfeeb44e69832b3d301958a4108d8.tar.gz blackbird-op-linux-81ffbf654f0cfeeb44e69832b3d301958a4108d8.zip |
GFS2: Add origin indicator to glock callbacks
This patch adds a bool indicating whether the demote
request was originated locally or remotely. This is then
used by the iopen ->go_callback() to make 100% sure that
it will only respond to remote callbacks.
Since ->evict_inode() uses GL_NOCACHE when it attempts to
get an exclusive lock on the iopen lock, this may result
in extra scheduling of the workqueue in case that the
exclusive promotion request failed. This patch prevents
that from happening.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glops.c')
-rw-r--r-- | fs/gfs2/glops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 444b6503ebc4..c66e99c97571 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -515,12 +515,12 @@ static int trans_go_demote_ok(const struct gfs2_glock *gl) * * gl_spin lock is held while calling this */ -static void iopen_go_callback(struct gfs2_glock *gl) +static void iopen_go_callback(struct gfs2_glock *gl, bool remote) { struct gfs2_inode *ip = (struct gfs2_inode *)gl->gl_object; struct gfs2_sbd *sdp = gl->gl_sbd; - if (sdp->sd_vfs->s_flags & MS_RDONLY) + if (!remote || (sdp->sd_vfs->s_flags & MS_RDONLY)) return; if (gl->gl_demote_state == LM_ST_UNLOCKED && |