ocfs2: fix some small problems
PATCH 4/11 ocfs2: fix some small problems
From: Gang He <[email protected]>
Subject: ocfs2: fix some small problems
First, move setting fe_done = 1 in spin lock, avoid bring any potential race condition.
Second, tune mlog message level from ERROR to NOTICE, since the message should not belong to error message.
Third, tune errno to -EAGAIN when file check queue is full, this errno is more appropriate in the case.
Signed-off-by Gang He <[email protected]>
Cc Mark Fasheh <[email protected]>
Cc Joel Becker <[email protected]>
Cc Junxiao Bi <[email protected]>
Cc Joseph Qi <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
fs/ocfs2/filecheck.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/ocfs2/filecheck.c renamed from fs/ocfs2/filecheck.c~ocfs2-fix-some-small-problems +4 -4
@@ -282,7 +282,7 @@ ocfs2_filecheck_adjust_max(struct ocfs2_spin_lock (&ent->fs_fcheck->fc_lock);if (len < (ent->fs_fcheck->fc_size - ent->fs_fcheck->fc_done)) { -mlog (ML_ERROR , +mlog (ML_NOTICE ,"Cannot set online file check maximum entry number " "to %u due to too many pending entries(%u)\n" , len, ent->fs_fcheck->fc_size - ent->fs_fcheck->fc_done);
@@ -456,8 +456,8 @@ static void ocfs2_filecheck_done_entry(struct ocfs2_filecheck_sysfs_entry *ent, struct ocfs2_filecheck_entry *entry) { - entry->fe_done = 1; spin_lock(&ent->fs_fcheck->fc_lock); + entry->fe_done =1 ; ent->fs_fcheck->fc_done++;spin_unlock (&ent->fs_fcheck->fc_lock); }
@@ -539,11 +539,11 @@ static ssize_t ocfs2_filecheck_store(strspin_lock (&ent->fs_fcheck->fc_lock);if ((ent->fs_fcheck->fc_size >= ent->fs_fcheck->fc_max) && (ent->fs_fcheck->fc_done ==0 )) { -mlog (ML_ERROR , +mlog (ML_NOTICE ,"Cannot do more file check " "since file check queue(%u) is full now\n" , ent->fs_fcheck->fc_max); - ret = -EBUSY ; + ret = -EAGAIN ;kfree (entry); }else { if ((ent->fs_fcheck->fc_size >= ent->fs_fcheck->fc_max) &&
_