diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-09-08 09:38:01 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-09-30 04:12:58 -0400 |
commit | ba60ecabf067c8ecbde47af4d99b74ee57234d8e (patch) | |
tree | f5dcd47beb1a9b0899768e932bacfc8496902d81 /fs/ubifs/ubifs.h | |
parent | ed382d5898ccfc3d7ba775be2f1596f6a1547935 (diff) |
UBIFS: fix races in bit-fields
We cannot store bit-fields together if the processes which
change them may race, unless we serialize them.
Thus, move the nospc and nospc_rp bit-fields eway from
the mount option/constant bit-fields, to avoid races.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/ubifs.h')
-rw-r--r-- | fs/ubifs/ubifs.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 542cbafe76e1..c3ac5a8221ff 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -334,7 +334,7 @@ struct ubifs_gced_idx_leb { | |||
334 | * @bulk_read: non-zero if bulk-read should be used | 334 | * @bulk_read: non-zero if bulk-read should be used |
335 | * @ui_mutex: serializes inode write-back with the rest of VFS operations, | 335 | * @ui_mutex: serializes inode write-back with the rest of VFS operations, |
336 | * serializes "clean <-> dirty" state changes, serializes bulk-read, | 336 | * serializes "clean <-> dirty" state changes, serializes bulk-read, |
337 | * protects @dirty, @ui_size, and @xattr_size | 337 | * protects @dirty, @bulk_read, @ui_size, and @xattr_size |
338 | * @ui_lock: protects @synced_i_size | 338 | * @ui_lock: protects @synced_i_size |
339 | * @synced_i_size: synchronized size of inode, i.e. the value of inode size | 339 | * @synced_i_size: synchronized size of inode, i.e. the value of inode size |
340 | * currently stored on the flash; used only for regular file | 340 | * currently stored on the flash; used only for regular file |
@@ -944,10 +944,6 @@ struct ubifs_mount_opts { | |||
944 | * @fast_unmount: do not run journal commit before un-mounting | 944 | * @fast_unmount: do not run journal commit before un-mounting |
945 | * @big_lpt: flag that LPT is too big to write whole during commit | 945 | * @big_lpt: flag that LPT is too big to write whole during commit |
946 | * @check_lpt_free: flag that indicates LPT GC may be needed | 946 | * @check_lpt_free: flag that indicates LPT GC may be needed |
947 | * @nospace: non-zero if the file-system does not have flash space (used as | ||
948 | * optimization) | ||
949 | * @nospace_rp: the same as @nospace, but additionally means that even reserved | ||
950 | * pool is full | ||
951 | * @no_chk_data_crc: do not check CRCs when reading data nodes (except during | 947 | * @no_chk_data_crc: do not check CRCs when reading data nodes (except during |
952 | * recovery) | 948 | * recovery) |
953 | * @bulk_read: enable bulk-reads | 949 | * @bulk_read: enable bulk-reads |
@@ -1017,12 +1013,17 @@ struct ubifs_mount_opts { | |||
1017 | * but which still have to be taken into account because | 1013 | * but which still have to be taken into account because |
1018 | * the index has not been committed so far | 1014 | * the index has not been committed so far |
1019 | * @space_lock: protects @budg_idx_growth, @budg_data_growth, @budg_dd_growth, | 1015 | * @space_lock: protects @budg_idx_growth, @budg_data_growth, @budg_dd_growth, |
1020 | * @budg_uncommited_idx, @min_idx_lebs, @old_idx_sz, and @lst; | 1016 | * @budg_uncommited_idx, @min_idx_lebs, @old_idx_sz, @lst, |
1017 | * @nospace, and @nospace_rp; | ||
1021 | * @min_idx_lebs: minimum number of LEBs required for the index | 1018 | * @min_idx_lebs: minimum number of LEBs required for the index |
1022 | * @old_idx_sz: size of index on flash | 1019 | * @old_idx_sz: size of index on flash |
1023 | * @calc_idx_sz: temporary variable which is used to calculate new index size | 1020 | * @calc_idx_sz: temporary variable which is used to calculate new index size |
1024 | * (contains accurate new index size at end of TNC commit start) | 1021 | * (contains accurate new index size at end of TNC commit start) |
1025 | * @lst: lprops statistics | 1022 | * @lst: lprops statistics |
1023 | * @nospace: non-zero if the file-system does not have flash space (used as | ||
1024 | * optimization) | ||
1025 | * @nospace_rp: the same as @nospace, but additionally means that even reserved | ||
1026 | * pool is full | ||
1026 | * | 1027 | * |
1027 | * @page_budget: budget for a page | 1028 | * @page_budget: budget for a page |
1028 | * @inode_budget: budget for an inode | 1029 | * @inode_budget: budget for an inode |
@@ -1191,8 +1192,6 @@ struct ubifs_info { | |||
1191 | unsigned int fast_unmount:1; | 1192 | unsigned int fast_unmount:1; |
1192 | unsigned int big_lpt:1; | 1193 | unsigned int big_lpt:1; |
1193 | unsigned int check_lpt_free:1; | 1194 | unsigned int check_lpt_free:1; |
1194 | unsigned int nospace:1; | ||
1195 | unsigned int nospace_rp:1; | ||
1196 | unsigned int no_chk_data_crc:1; | 1195 | unsigned int no_chk_data_crc:1; |
1197 | unsigned int bulk_read:1; | 1196 | unsigned int bulk_read:1; |
1198 | 1197 | ||
@@ -1263,6 +1262,8 @@ struct ubifs_info { | |||
1263 | unsigned long long old_idx_sz; | 1262 | unsigned long long old_idx_sz; |
1264 | unsigned long long calc_idx_sz; | 1263 | unsigned long long calc_idx_sz; |
1265 | struct ubifs_lp_stats lst; | 1264 | struct ubifs_lp_stats lst; |
1265 | unsigned int nospace:1; | ||
1266 | unsigned int nospace_rp:1; | ||
1266 | 1267 | ||
1267 | int page_budget; | 1268 | int page_budget; |
1268 | int inode_budget; | 1269 | int inode_budget; |