Commit 1b7fa4c2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2

Pull ocfs2 fixes from Joel Becker.

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
  aio: make kiocb->private NUll in init_sync_kiocb()
  ocfs2: Fix bogus error message from ocfs2_global_read_info
  ocfs2: for SEEK_DATA/SEEK_HOLE, return internal error unchanged if ocfs2_get_clusters_nocache() or ocfs2_inode_lock() call failed.
  ocfs2: use spinlock irqsave for downconvert lock.patch
  ocfs2: Misplaced parens in unlikley
  ocfs2: clear unaligned io flag when dio fails
parents 064ea1ae 2dfd0603
...@@ -456,7 +456,7 @@ static void ocfs2_update_lock_stats(struct ocfs2_lock_res *res, int level, ...@@ -456,7 +456,7 @@ static void ocfs2_update_lock_stats(struct ocfs2_lock_res *res, int level,
stats->ls_gets++; stats->ls_gets++;
stats->ls_total += ktime_to_ns(kt); stats->ls_total += ktime_to_ns(kt);
/* overflow */ /* overflow */
if (unlikely(stats->ls_gets) == 0) { if (unlikely(stats->ls_gets == 0)) {
stats->ls_gets++; stats->ls_gets++;
stats->ls_total = ktime_to_ns(kt); stats->ls_total = ktime_to_ns(kt);
} }
...@@ -3932,6 +3932,8 @@ static void ocfs2_process_blocked_lock(struct ocfs2_super *osb, ...@@ -3932,6 +3932,8 @@ static void ocfs2_process_blocked_lock(struct ocfs2_super *osb,
static void ocfs2_schedule_blocked_lock(struct ocfs2_super *osb, static void ocfs2_schedule_blocked_lock(struct ocfs2_super *osb,
struct ocfs2_lock_res *lockres) struct ocfs2_lock_res *lockres)
{ {
unsigned long flags;
assert_spin_locked(&lockres->l_lock); assert_spin_locked(&lockres->l_lock);
if (lockres->l_flags & OCFS2_LOCK_FREEING) { if (lockres->l_flags & OCFS2_LOCK_FREEING) {
...@@ -3945,21 +3947,22 @@ static void ocfs2_schedule_blocked_lock(struct ocfs2_super *osb, ...@@ -3945,21 +3947,22 @@ static void ocfs2_schedule_blocked_lock(struct ocfs2_super *osb,
lockres_or_flags(lockres, OCFS2_LOCK_QUEUED); lockres_or_flags(lockres, OCFS2_LOCK_QUEUED);
spin_lock(&osb->dc_task_lock); spin_lock_irqsave(&osb->dc_task_lock, flags);
if (list_empty(&lockres->l_blocked_list)) { if (list_empty(&lockres->l_blocked_list)) {
list_add_tail(&lockres->l_blocked_list, list_add_tail(&lockres->l_blocked_list,
&osb->blocked_lock_list); &osb->blocked_lock_list);
osb->blocked_lock_count++; osb->blocked_lock_count++;
} }
spin_unlock(&osb->dc_task_lock); spin_unlock_irqrestore(&osb->dc_task_lock, flags);
} }
static void ocfs2_downconvert_thread_do_work(struct ocfs2_super *osb) static void ocfs2_downconvert_thread_do_work(struct ocfs2_super *osb)
{ {
unsigned long processed; unsigned long processed;
unsigned long flags;
struct ocfs2_lock_res *lockres; struct ocfs2_lock_res *lockres;
spin_lock(&osb->dc_task_lock); spin_lock_irqsave(&osb->dc_task_lock, flags);
/* grab this early so we know to try again if a state change and /* grab this early so we know to try again if a state change and
* wake happens part-way through our work */ * wake happens part-way through our work */
osb->dc_work_sequence = osb->dc_wake_sequence; osb->dc_work_sequence = osb->dc_wake_sequence;
...@@ -3972,38 +3975,40 @@ static void ocfs2_downconvert_thread_do_work(struct ocfs2_super *osb) ...@@ -3972,38 +3975,40 @@ static void ocfs2_downconvert_thread_do_work(struct ocfs2_super *osb)
struct ocfs2_lock_res, l_blocked_list); struct ocfs2_lock_res, l_blocked_list);
list_del_init(&lockres->l_blocked_list); list_del_init(&lockres->l_blocked_list);
osb->blocked_lock_count--; osb->blocked_lock_count--;
spin_unlock(&osb->dc_task_lock); spin_unlock_irqrestore(&osb->dc_task_lock, flags);
BUG_ON(!processed); BUG_ON(!processed);
processed--; processed--;
ocfs2_process_blocked_lock(osb, lockres); ocfs2_process_blocked_lock(osb, lockres);
spin_lock(&osb->dc_task_lock); spin_lock_irqsave(&osb->dc_task_lock, flags);
} }
spin_unlock(&osb->dc_task_lock); spin_unlock_irqrestore(&osb->dc_task_lock, flags);
} }
static int ocfs2_downconvert_thread_lists_empty(struct ocfs2_super *osb) static int ocfs2_downconvert_thread_lists_empty(struct ocfs2_super *osb)
{ {
int empty = 0; int empty = 0;
unsigned long flags;
spin_lock(&osb->dc_task_lock); spin_lock_irqsave(&osb->dc_task_lock, flags);
if (list_empty(&osb->blocked_lock_list)) if (list_empty(&osb->blocked_lock_list))
empty = 1; empty = 1;
spin_unlock(&osb->dc_task_lock); spin_unlock_irqrestore(&osb->dc_task_lock, flags);
return empty; return empty;
} }
static int ocfs2_downconvert_thread_should_wake(struct ocfs2_super *osb) static int ocfs2_downconvert_thread_should_wake(struct ocfs2_super *osb)
{ {
int should_wake = 0; int should_wake = 0;
unsigned long flags;
spin_lock(&osb->dc_task_lock); spin_lock_irqsave(&osb->dc_task_lock, flags);
if (osb->dc_work_sequence != osb->dc_wake_sequence) if (osb->dc_work_sequence != osb->dc_wake_sequence)
should_wake = 1; should_wake = 1;
spin_unlock(&osb->dc_task_lock); spin_unlock_irqrestore(&osb->dc_task_lock, flags);
return should_wake; return should_wake;
} }
...@@ -4033,10 +4038,12 @@ static int ocfs2_downconvert_thread(void *arg) ...@@ -4033,10 +4038,12 @@ static int ocfs2_downconvert_thread(void *arg)
void ocfs2_wake_downconvert_thread(struct ocfs2_super *osb) void ocfs2_wake_downconvert_thread(struct ocfs2_super *osb)
{ {
spin_lock(&osb->dc_task_lock); unsigned long flags;
spin_lock_irqsave(&osb->dc_task_lock, flags);
/* make sure the voting thread gets a swipe at whatever changes /* make sure the voting thread gets a swipe at whatever changes
* the caller may have made to the voting state */ * the caller may have made to the voting state */
osb->dc_wake_sequence++; osb->dc_wake_sequence++;
spin_unlock(&osb->dc_task_lock); spin_unlock_irqrestore(&osb->dc_task_lock, flags);
wake_up(&osb->dc_event); wake_up(&osb->dc_event);
} }
...@@ -923,8 +923,6 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin) ...@@ -923,8 +923,6 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
ocfs2_inode_unlock(inode, 0); ocfs2_inode_unlock(inode, 0);
out: out:
if (ret && ret != -ENXIO)
ret = -ENXIO;
return ret; return ret;
} }
......
...@@ -2422,8 +2422,10 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, ...@@ -2422,8 +2422,10 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
unaligned_dio = 0; unaligned_dio = 0;
} }
if (unaligned_dio) if (unaligned_dio) {
ocfs2_iocb_clear_unaligned_aio(iocb);
atomic_dec(&OCFS2_I(inode)->ip_unaligned_aio); atomic_dec(&OCFS2_I(inode)->ip_unaligned_aio);
}
out: out:
if (rw_level != -1) if (rw_level != -1)
......
...@@ -399,8 +399,6 @@ int ocfs2_global_read_info(struct super_block *sb, int type) ...@@ -399,8 +399,6 @@ int ocfs2_global_read_info(struct super_block *sb, int type)
msecs_to_jiffies(oinfo->dqi_syncms)); msecs_to_jiffies(oinfo->dqi_syncms));
out_err: out_err:
if (status)
mlog_errno(status);
return status; return status;
out_unlock: out_unlock:
ocfs2_unlock_global_qf(oinfo, 0); ocfs2_unlock_global_qf(oinfo, 0);
......
...@@ -140,6 +140,7 @@ struct kiocb { ...@@ -140,6 +140,7 @@ struct kiocb {
(x)->ki_dtor = NULL; \ (x)->ki_dtor = NULL; \
(x)->ki_obj.tsk = tsk; \ (x)->ki_obj.tsk = tsk; \
(x)->ki_user_data = 0; \ (x)->ki_user_data = 0; \
(x)->private = NULL; \
} while (0) } while (0)
#define AIO_RING_MAGIC 0xa10a10a1 #define AIO_RING_MAGIC 0xa10a10a1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment