diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-06 13:04:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-06 13:04:39 -0400 |
commit | 1b7fa4c27111757789b21bb78543317dad4cfd08 (patch) | |
tree | a160c42485acf01ade88bee0d7f1d775a4eb3002 | |
parent | 064ea1ae80749f5548a5613e8c7772fbef34c857 (diff) | |
parent | 2dfd06036ba7ae8e7be2daf5a2fff1dac42390bf (diff) |
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
-rw-r--r-- | fs/ocfs2/dlmglue.c | 33 | ||||
-rw-r--r-- | fs/ocfs2/extent_map.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/file.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/quota_global.c | 2 | ||||
-rw-r--r-- | include/linux/aio.h | 1 |
5 files changed, 24 insertions, 18 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 81a4cd22f80b..4f7795fb5fc0 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -456,7 +456,7 @@ static void ocfs2_update_lock_stats(struct ocfs2_lock_res *res, int level, | |||
456 | stats->ls_gets++; | 456 | stats->ls_gets++; |
457 | stats->ls_total += ktime_to_ns(kt); | 457 | stats->ls_total += ktime_to_ns(kt); |
458 | /* overflow */ | 458 | /* overflow */ |
459 | if (unlikely(stats->ls_gets) == 0) { | 459 | if (unlikely(stats->ls_gets == 0)) { |
460 | stats->ls_gets++; | 460 | stats->ls_gets++; |
461 | stats->ls_total = ktime_to_ns(kt); | 461 | stats->ls_total = ktime_to_ns(kt); |
462 | } | 462 | } |
@@ -3932,6 +3932,8 @@ unqueue: | |||
3932 | static void ocfs2_schedule_blocked_lock(struct ocfs2_super *osb, | 3932 | static void ocfs2_schedule_blocked_lock(struct ocfs2_super *osb, |
3933 | struct ocfs2_lock_res *lockres) | 3933 | struct ocfs2_lock_res *lockres) |
3934 | { | 3934 | { |
3935 | unsigned long flags; | ||
3936 | |||
3935 | assert_spin_locked(&lockres->l_lock); | 3937 | assert_spin_locked(&lockres->l_lock); |
3936 | 3938 | ||
3937 | if (lockres->l_flags & OCFS2_LOCK_FREEING) { | 3939 | if (lockres->l_flags & OCFS2_LOCK_FREEING) { |
@@ -3945,21 +3947,22 @@ static void ocfs2_schedule_blocked_lock(struct ocfs2_super *osb, | |||
3945 | 3947 | ||
3946 | lockres_or_flags(lockres, OCFS2_LOCK_QUEUED); | 3948 | lockres_or_flags(lockres, OCFS2_LOCK_QUEUED); |
3947 | 3949 | ||
3948 | spin_lock(&osb->dc_task_lock); | 3950 | spin_lock_irqsave(&osb->dc_task_lock, flags); |
3949 | if (list_empty(&lockres->l_blocked_list)) { | 3951 | if (list_empty(&lockres->l_blocked_list)) { |
3950 | list_add_tail(&lockres->l_blocked_list, | 3952 | list_add_tail(&lockres->l_blocked_list, |
3951 | &osb->blocked_lock_list); | 3953 | &osb->blocked_lock_list); |
3952 | osb->blocked_lock_count++; | 3954 | osb->blocked_lock_count++; |
3953 | } | 3955 | } |
3954 | spin_unlock(&osb->dc_task_lock); | 3956 | spin_unlock_irqrestore(&osb->dc_task_lock, flags); |
3955 | } | 3957 | } |
3956 | 3958 | ||
3957 | static void ocfs2_downconvert_thread_do_work(struct ocfs2_super *osb) | 3959 | static void ocfs2_downconvert_thread_do_work(struct ocfs2_super *osb) |
3958 | { | 3960 | { |
3959 | unsigned long processed; | 3961 | unsigned long processed; |
3962 | unsigned long flags; | ||
3960 | struct ocfs2_lock_res *lockres; | 3963 | struct ocfs2_lock_res *lockres; |
3961 | 3964 | ||
3962 | spin_lock(&osb->dc_task_lock); | 3965 | spin_lock_irqsave(&osb->dc_task_lock, flags); |
3963 | /* grab this early so we know to try again if a state change and | 3966 | /* grab this early so we know to try again if a state change and |
3964 | * wake happens part-way through our work */ | 3967 | * wake happens part-way through our work */ |
3965 | osb->dc_work_sequence = osb->dc_wake_sequence; | 3968 | osb->dc_work_sequence = osb->dc_wake_sequence; |
@@ -3972,38 +3975,40 @@ static void ocfs2_downconvert_thread_do_work(struct ocfs2_super *osb) | |||
3972 | struct ocfs2_lock_res, l_blocked_list); | 3975 | struct ocfs2_lock_res, l_blocked_list); |
3973 | list_del_init(&lockres->l_blocked_list); | 3976 | list_del_init(&lockres->l_blocked_list); |
3974 | osb->blocked_lock_count--; | 3977 | osb->blocked_lock_count--; |
3975 | spin_unlock(&osb->dc_task_lock); | 3978 | spin_unlock_irqrestore(&osb->dc_task_lock, flags); |
3976 | 3979 | ||
3977 | BUG_ON(!processed); | 3980 | BUG_ON(!processed); |
3978 | processed--; | 3981 | processed--; |
3979 | 3982 | ||
3980 | ocfs2_process_blocked_lock(osb, lockres); | 3983 | ocfs2_process_blocked_lock(osb, lockres); |
3981 | 3984 | ||
3982 | spin_lock(&osb->dc_task_lock); | 3985 | spin_lock_irqsave(&osb->dc_task_lock, flags); |
3983 | } | 3986 | } |
3984 | spin_unlock(&osb->dc_task_lock); | 3987 | spin_unlock_irqrestore(&osb->dc_task_lock, flags); |
3985 | } | 3988 | } |
3986 | 3989 | ||
3987 | static int ocfs2_downconvert_thread_lists_empty(struct ocfs2_super *osb) | 3990 | static int ocfs2_downconvert_thread_lists_empty(struct ocfs2_super *osb) |
3988 | { | 3991 | { |
3989 | int empty = 0; | 3992 | int empty = 0; |
3993 | unsigned long flags; | ||
3990 | 3994 | ||
3991 | spin_lock(&osb->dc_task_lock); | 3995 | spin_lock_irqsave(&osb->dc_task_lock, flags); |
3992 | if (list_empty(&osb->blocked_lock_list)) | 3996 | if (list_empty(&osb->blocked_lock_list)) |
3993 | empty = 1; | 3997 | empty = 1; |
3994 | 3998 | ||
3995 | spin_unlock(&osb->dc_task_lock); | 3999 | spin_unlock_irqrestore(&osb->dc_task_lock, flags); |
3996 | return empty; | 4000 | return empty; |
3997 | } | 4001 | } |
3998 | 4002 | ||
3999 | static int ocfs2_downconvert_thread_should_wake(struct ocfs2_super *osb) | 4003 | static int ocfs2_downconvert_thread_should_wake(struct ocfs2_super *osb) |
4000 | { | 4004 | { |
4001 | int should_wake = 0; | 4005 | int should_wake = 0; |
4006 | unsigned long flags; | ||
4002 | 4007 | ||
4003 | spin_lock(&osb->dc_task_lock); | 4008 | spin_lock_irqsave(&osb->dc_task_lock, flags); |
4004 | if (osb->dc_work_sequence != osb->dc_wake_sequence) | 4009 | if (osb->dc_work_sequence != osb->dc_wake_sequence) |
4005 | should_wake = 1; | 4010 | should_wake = 1; |
4006 | spin_unlock(&osb->dc_task_lock); | 4011 | spin_unlock_irqrestore(&osb->dc_task_lock, flags); |
4007 | 4012 | ||
4008 | return should_wake; | 4013 | return should_wake; |
4009 | } | 4014 | } |
@@ -4033,10 +4038,12 @@ static int ocfs2_downconvert_thread(void *arg) | |||
4033 | 4038 | ||
4034 | void ocfs2_wake_downconvert_thread(struct ocfs2_super *osb) | 4039 | void ocfs2_wake_downconvert_thread(struct ocfs2_super *osb) |
4035 | { | 4040 | { |
4036 | spin_lock(&osb->dc_task_lock); | 4041 | unsigned long flags; |
4042 | |||
4043 | spin_lock_irqsave(&osb->dc_task_lock, flags); | ||
4037 | /* make sure the voting thread gets a swipe at whatever changes | 4044 | /* make sure the voting thread gets a swipe at whatever changes |
4038 | * the caller may have made to the voting state */ | 4045 | * the caller may have made to the voting state */ |
4039 | osb->dc_wake_sequence++; | 4046 | osb->dc_wake_sequence++; |
4040 | spin_unlock(&osb->dc_task_lock); | 4047 | spin_unlock_irqrestore(&osb->dc_task_lock, flags); |
4041 | wake_up(&osb->dc_event); | 4048 | wake_up(&osb->dc_event); |
4042 | } | 4049 | } |
diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c index 2f5b92ef0e53..70b5863a2d64 100644 --- a/fs/ocfs2/extent_map.c +++ b/fs/ocfs2/extent_map.c | |||
@@ -923,8 +923,6 @@ out_unlock: | |||
923 | 923 | ||
924 | ocfs2_inode_unlock(inode, 0); | 924 | ocfs2_inode_unlock(inode, 0); |
925 | out: | 925 | out: |
926 | if (ret && ret != -ENXIO) | ||
927 | ret = -ENXIO; | ||
928 | return ret; | 926 | return ret; |
929 | } | 927 | } |
930 | 928 | ||
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 061591a3ab08..98513c8ed589 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -2422,8 +2422,10 @@ out_dio: | |||
2422 | unaligned_dio = 0; | 2422 | unaligned_dio = 0; |
2423 | } | 2423 | } |
2424 | 2424 | ||
2425 | if (unaligned_dio) | 2425 | if (unaligned_dio) { |
2426 | ocfs2_iocb_clear_unaligned_aio(iocb); | ||
2426 | atomic_dec(&OCFS2_I(inode)->ip_unaligned_aio); | 2427 | atomic_dec(&OCFS2_I(inode)->ip_unaligned_aio); |
2428 | } | ||
2427 | 2429 | ||
2428 | out: | 2430 | out: |
2429 | if (rw_level != -1) | 2431 | if (rw_level != -1) |
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index 92fcd575775a..0a86e302655f 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c | |||
@@ -399,8 +399,6 @@ int ocfs2_global_read_info(struct super_block *sb, int type) | |||
399 | msecs_to_jiffies(oinfo->dqi_syncms)); | 399 | msecs_to_jiffies(oinfo->dqi_syncms)); |
400 | 400 | ||
401 | out_err: | 401 | out_err: |
402 | if (status) | ||
403 | mlog_errno(status); | ||
404 | return status; | 402 | return status; |
405 | out_unlock: | 403 | out_unlock: |
406 | ocfs2_unlock_global_qf(oinfo, 0); | 404 | ocfs2_unlock_global_qf(oinfo, 0); |
diff --git a/include/linux/aio.h b/include/linux/aio.h index 2314ad8b3c9c..b1a520ec8b59 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -140,6 +140,7 @@ struct kiocb { | |||
140 | (x)->ki_dtor = NULL; \ | 140 | (x)->ki_dtor = NULL; \ |
141 | (x)->ki_obj.tsk = tsk; \ | 141 | (x)->ki_obj.tsk = tsk; \ |
142 | (x)->ki_user_data = 0; \ | 142 | (x)->ki_user_data = 0; \ |
143 | (x)->private = NULL; \ | ||
143 | } while (0) | 144 | } while (0) |
144 | 145 | ||
145 | #define AIO_RING_MAGIC 0xa10a10a1 | 146 | #define AIO_RING_MAGIC 0xa10a10a1 |