Skip to content

Commit f3270b1

Browse files
committed
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2: (48 commits) ocfs2: Avoid to evaluate xattr block flags again. ocfs2/cluster: Release debugfs file elapsed_time_in_ms ocfs2: Add a mount option "coherency=*" to handle cluster coherency for O_DIRECT writes. Initialize max_slots early When I tried to compile I got the following warning: fs/ocfs2/slot_map.c: In function ‘ocfs2_init_slot_info’: fs/ocfs2/slot_map.c:360: warning: ‘bytes’ may be used uninitialized in this function fs/ocfs2/slot_map.c:360: note: ‘bytes’ was declared here Compiler: gcc version 4.4.3 (GCC) on Mandriva I'm not sure why this warning occurs, I think compiler don't know that variable "bytes" is initialized when it is sent by reference to ocfs2_slot_map_physical_size and it throws that ugly warning. However, a simple initialization of "bytes" variable with 0 will fix it. ocfs2: validate bg_free_bits_count after update ocfs2/cluster: Bump up dlm protocol to version 1.1 ocfs2/cluster: Show per region heartbeat elapsed time ocfs2/cluster: Add mlogs for heartbeat up/down events ocfs2/cluster: Create debugfs dir/files for each region ocfs2/cluster: Create debugfs files for live, quorum and failed region bitmaps ocfs2/cluster: Maintain bitmap of failed regions ocfs2/cluster: Maintain bitmap of quorum regions ocfs2/cluster: Track bitmap of live heartbeat regions ocfs2/cluster: Track number of global heartbeat regions ocfs2/cluster: Maintain live node bitmap per heartbeat region ocfs2/cluster: Reorganize o2hb debugfs init ocfs2/cluster: Check slots for unconfigured live nodes ocfs2/cluster: Print messages when adding/removing nodes ocfs2/cluster: Print messages when adding/removing heartbeat regions ...
2 parents 3044100 + 2decd65 commit f3270b1

39 files changed

Lines changed: 1894 additions & 173 deletions

‎Documentation/filesystems/ocfs2.txt‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,10 @@ dir_resv_level= (*) By default, directory reservations will scale with file
8787
reservations - users should rarely need to change this
8888
value. If allocation reservations are turned off, this
8989
option will have no effect.
90+
coherency=full (*) Disallow concurrent O_DIRECT writes, cluster inode
91+
lock will be taken to force other nodes drop cache,
92+
therefore full cluster coherency is guaranteed even
93+
for O_DIRECT writes.
94+
coherency=buffered Allow concurrent O_DIRECT writes without EX lock among
95+
nodes, which gains high performance at risk of getting
96+
stale data on other nodes.

‎fs/ext3/super.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,8 +1849,8 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
18491849
goto failed_mount;
18501850
}
18511851

1852-
if (le32_to_cpu(es->s_blocks_count) >
1853-
(sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) {
1852+
if (generic_check_addressable(sb->s_blocksize_bits,
1853+
le32_to_cpu(es->s_blocks_count))) {
18541854
ext3_msg(sb, KERN_ERR,
18551855
"error: filesystem is too large to mount safely");
18561856
if (sizeof(sector_t) < 8)

‎fs/ext4/super.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2831,15 +2831,13 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
28312831
* Test whether we have more sectors than will fit in sector_t,
28322832
* and whether the max offset is addressable by the page cache.
28332833
*/
2834-
if ((ext4_blocks_count(es) >
2835-
(sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) ||
2836-
(ext4_blocks_count(es) >
2837-
(pgoff_t)(~0ULL) >> (PAGE_CACHE_SHIFT - sb->s_blocksize_bits))) {
2834+
ret = generic_check_addressable(sb->s_blocksize_bits,
2835+
ext4_blocks_count(es));
2836+
if (ret) {
28382837
ext4_msg(sb, KERN_ERR, "filesystem"
28392838
" too large to mount safely on this system");
28402839
if (sizeof(sector_t) < 8)
28412840
ext4_msg(sb, KERN_WARNING, "CONFIG_LBDAF not enabled");
2842-
ret = -EFBIG;
28432841
goto failed_mount;
28442842
}
28452843

‎fs/jbd2/journal.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,6 +1371,10 @@ int jbd2_journal_check_used_features (journal_t *journal, unsigned long compat,
13711371

13721372
if (!compat && !ro && !incompat)
13731373
return 1;
1374+
/* Load journal superblock if it is not loaded yet. */
1375+
if (journal->j_format_version == 0 &&
1376+
journal_get_superblock(journal) != 0)
1377+
return 0;
13741378
if (journal->j_format_version == 1)
13751379
return 0;
13761380

‎fs/libfs.c‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,35 @@ int generic_file_fsync(struct file *file, int datasync)
913913
}
914914
EXPORT_SYMBOL(generic_file_fsync);
915915

916+
/**
917+
* generic_check_addressable - Check addressability of file system
918+
* @blocksize_bits: log of file system block size
919+
* @num_blocks: number of blocks in file system
920+
*
921+
* Determine whether a file system with @num_blocks blocks (and a
922+
* block size of 2**@blocksize_bits) is addressable by the sector_t
923+
* and page cache of the system. Return 0 if so and -EFBIG otherwise.
924+
*/
925+
int generic_check_addressable(unsigned blocksize_bits, u64 num_blocks)
926+
{
927+
u64 last_fs_block = num_blocks - 1;
928+
u64 last_fs_page =
929+
last_fs_block >> (PAGE_CACHE_SHIFT - blocksize_bits);
930+
931+
if (unlikely(num_blocks == 0))
932+
return 0;
933+
934+
if ((blocksize_bits < 9) || (blocksize_bits > PAGE_CACHE_SHIFT))
935+
return -EINVAL;
936+
937+
if ((last_fs_block > (sector_t)(~0ULL) >> (blocksize_bits - 9)) ||
938+
(last_fs_page > (pgoff_t)(~0ULL))) {
939+
return -EFBIG;
940+
}
941+
return 0;
942+
}
943+
EXPORT_SYMBOL(generic_check_addressable);
944+
916945
/*
917946
* No-op implementation of ->fsync for in-memory filesystems.
918947
*/

‎fs/ocfs2/aops.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -883,8 +883,8 @@ struct ocfs2_write_ctxt {
883883
* out in so that future reads from that region will get
884884
* zero's.
885885
*/
886-
struct page *w_pages[OCFS2_MAX_CTXT_PAGES];
887886
unsigned int w_num_pages;
887+
struct page *w_pages[OCFS2_MAX_CTXT_PAGES];
888888
struct page *w_target_page;
889889

890890
/*
@@ -1642,7 +1642,8 @@ static int ocfs2_zero_tail(struct inode *inode, struct buffer_head *di_bh,
16421642
return ret;
16431643
}
16441644

1645-
int ocfs2_write_begin_nolock(struct address_space *mapping,
1645+
int ocfs2_write_begin_nolock(struct file *filp,
1646+
struct address_space *mapping,
16461647
loff_t pos, unsigned len, unsigned flags,
16471648
struct page **pagep, void **fsdata,
16481649
struct buffer_head *di_bh, struct page *mmap_page)
@@ -1692,7 +1693,7 @@ int ocfs2_write_begin_nolock(struct address_space *mapping,
16921693
mlog_errno(ret);
16931694
goto out;
16941695
} else if (ret == 1) {
1695-
ret = ocfs2_refcount_cow(inode, di_bh,
1696+
ret = ocfs2_refcount_cow(inode, filp, di_bh,
16961697
wc->w_cpos, wc->w_clen, UINT_MAX);
16971698
if (ret) {
16981699
mlog_errno(ret);
@@ -1854,7 +1855,7 @@ static int ocfs2_write_begin(struct file *file, struct address_space *mapping,
18541855
*/
18551856
down_write(&OCFS2_I(inode)->ip_alloc_sem);
18561857

1857-
ret = ocfs2_write_begin_nolock(mapping, pos, len, flags, pagep,
1858+
ret = ocfs2_write_begin_nolock(file, mapping, pos, len, flags, pagep,
18581859
fsdata, di_bh, NULL);
18591860
if (ret) {
18601861
mlog_errno(ret);

‎fs/ocfs2/aops.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ int ocfs2_write_end_nolock(struct address_space *mapping,
4848
loff_t pos, unsigned len, unsigned copied,
4949
struct page *page, void *fsdata);
5050

51-
int ocfs2_write_begin_nolock(struct address_space *mapping,
51+
int ocfs2_write_begin_nolock(struct file *filp,
52+
struct address_space *mapping,
5253
loff_t pos, unsigned len, unsigned flags,
5354
struct page **pagep, void **fsdata,
5455
struct buffer_head *di_bh, struct page *mmap_page);

0 commit comments

Comments
 (0)