aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/inode.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2009-09-02 20:17:36 -0400
committerJoel Becker <joel.becker@oracle.com>2010-05-10 14:50:10 -0400
commite4b963f10e9026c83419b5c25b93a0350413cf16 (patch)
treed162595c9f79626d040cb28c84e53fd8b7fe50ff /fs/ocfs2/inode.c
parent0467ae954d1843de65e7cf8f706f88fe65cd8418 (diff)
ocfs2: Wrap signal blocking in void functions.
ocfs2 sometimes needs to block signals around dlm operations, but it currently does it with sigprocmask(). Even worse, it's checking the error code of sigprocmask(). The in-kernel sigprocmask() can only error if you get the SIG_* argument wrong. We don't. Wrap the sigprocmask() calls with ocfs2_[un]block_signals(). These functions are void, but they will BUG() if somehow sigprocmask() returns an error. Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/inode.c')
-rw-r--r--fs/ocfs2/inode.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 9ee13f70da57..b7650ccd76d0 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -957,7 +957,7 @@ static void ocfs2_cleanup_delete_inode(struct inode *inode,
957void ocfs2_delete_inode(struct inode *inode) 957void ocfs2_delete_inode(struct inode *inode)
958{ 958{
959 int wipe, status; 959 int wipe, status;
960 sigset_t blocked, oldset; 960 sigset_t oldset;
961 struct buffer_head *di_bh = NULL; 961 struct buffer_head *di_bh = NULL;
962 962
963 mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino); 963 mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino);
@@ -984,13 +984,7 @@ void ocfs2_delete_inode(struct inode *inode)
984 * messaging paths may return us -ERESTARTSYS. Which would 984 * messaging paths may return us -ERESTARTSYS. Which would
985 * cause us to exit early, resulting in inodes being orphaned 985 * cause us to exit early, resulting in inodes being orphaned
986 * forever. */ 986 * forever. */
987 sigfillset(&blocked); 987 ocfs2_block_signals(&oldset);
988 status = sigprocmask(SIG_BLOCK, &blocked, &oldset);
989 if (status < 0) {
990 mlog_errno(status);
991 ocfs2_cleanup_delete_inode(inode, 1);
992 goto bail;
993 }
994 988
995 /* 989 /*
996 * Synchronize us against ocfs2_get_dentry. We take this in 990 * Synchronize us against ocfs2_get_dentry. We take this in
@@ -1064,9 +1058,7 @@ bail_unlock_nfs_sync:
1064 ocfs2_nfs_sync_unlock(OCFS2_SB(inode->i_sb), 0); 1058 ocfs2_nfs_sync_unlock(OCFS2_SB(inode->i_sb), 0);
1065 1059
1066bail_unblock: 1060bail_unblock:
1067 status = sigprocmask(SIG_SETMASK, &oldset, NULL); 1061 ocfs2_unblock_signals(&oldset);
1068 if (status < 0)
1069 mlog_errno(status);
1070bail: 1062bail:
1071 clear_inode(inode); 1063 clear_inode(inode);
1072 mlog_exit_void(); 1064 mlog_exit_void();