Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
ocfs2: export heartbeat thread pid via configfs
ocfs2: always unmap in ocfs2_data_convert_worker()
ocfs2: ignore NULL vfsmnt in ocfs2_should_update_atime()
ocfs2: Allow direct I/O read past end of file
ocfs2: don't print error in ocfs2_permission()

+54 -10
+17 -7
fs/ocfs2/aops.c
··· 540 540 struct buffer_head *bh_result, int create) 541 541 { 542 542 int ret; 543 - u64 vbo_max; /* file offset, max_blocks from iblock */ 544 - u64 p_blkno; 543 + u64 p_blkno, inode_blocks; 545 544 int contig_blocks; 546 545 unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; 547 546 unsigned long max_blocks = bh_result->b_size >> inode->i_blkbits; ··· 549 550 * nicely aligned and of the right size, so there's no need 550 551 * for us to check any of that. */ 551 552 552 - vbo_max = ((u64)iblock + max_blocks) << blocksize_bits; 553 - 554 553 spin_lock(&OCFS2_I(inode)->ip_lock); 555 - if ((iblock + max_blocks) > 556 - ocfs2_clusters_to_blocks(inode->i_sb, 557 - OCFS2_I(inode)->ip_clusters)) { 554 + inode_blocks = ocfs2_clusters_to_blocks(inode->i_sb, 555 + OCFS2_I(inode)->ip_clusters); 556 + 557 + /* 558 + * For a read which begins past the end of file, we return a hole. 559 + */ 560 + if (!create && (iblock >= inode_blocks)) { 561 + spin_unlock(&OCFS2_I(inode)->ip_lock); 562 + ret = 0; 563 + goto bail; 564 + } 565 + 566 + /* 567 + * Any write past EOF is not allowed because we'd be extending. 568 + */ 569 + if (create && (iblock + max_blocks) > inode_blocks) { 558 570 spin_unlock(&OCFS2_I(inode)->ip_lock); 559 571 ret = -EIO; 560 572 goto bail;
+17
fs/ocfs2/cluster/heartbeat.c
··· 1447 1447 return ret; 1448 1448 } 1449 1449 1450 + static ssize_t o2hb_region_pid_read(struct o2hb_region *reg, 1451 + char *page) 1452 + { 1453 + if (!reg->hr_task) 1454 + return 0; 1455 + 1456 + return sprintf(page, "%u\n", reg->hr_task->pid); 1457 + } 1458 + 1450 1459 struct o2hb_region_attribute { 1451 1460 struct configfs_attribute attr; 1452 1461 ssize_t (*show)(struct o2hb_region *, char *); ··· 1494 1485 .store = o2hb_region_dev_write, 1495 1486 }; 1496 1487 1488 + static struct o2hb_region_attribute o2hb_region_attr_pid = { 1489 + .attr = { .ca_owner = THIS_MODULE, 1490 + .ca_name = "pid", 1491 + .ca_mode = S_IRUGO | S_IRUSR }, 1492 + .show = o2hb_region_pid_read, 1493 + }; 1494 + 1497 1495 static struct configfs_attribute *o2hb_region_attrs[] = { 1498 1496 &o2hb_region_attr_block_bytes.attr, 1499 1497 &o2hb_region_attr_start_block.attr, 1500 1498 &o2hb_region_attr_blocks.attr, 1501 1499 &o2hb_region_attr_dev.attr, 1500 + &o2hb_region_attr_pid.attr, 1502 1501 NULL, 1503 1502 }; 1504 1503
+9 -1
fs/ocfs2/dlmglue.c
··· 2718 2718 inode = ocfs2_lock_res_inode(lockres); 2719 2719 mapping = inode->i_mapping; 2720 2720 2721 + /* 2722 + * We need this before the filemap_fdatawrite() so that it can 2723 + * transfer the dirty bit from the PTE to the 2724 + * page. Unfortunately this means that even for EX->PR 2725 + * downconverts, we'll lose our mappings and have to build 2726 + * them up again. 2727 + */ 2728 + unmap_mapping_range(mapping, 0, 0, 0); 2729 + 2721 2730 if (filemap_fdatawrite(mapping)) { 2722 2731 mlog(ML_ERROR, "Could not sync inode %llu for downconvert!", 2723 2732 (unsigned long long)OCFS2_I(inode)->ip_blkno); ··· 2734 2725 sync_mapping_buffers(mapping); 2735 2726 if (blocking == LKM_EXMODE) { 2736 2727 truncate_inode_pages(mapping, 0); 2737 - unmap_mapping_range(mapping, 0, 0, 0); 2738 2728 } else { 2739 2729 /* We only need to wait on the I/O if we're not also 2740 2730 * truncating pages because truncate_inode_pages waits
+11 -2
fs/ocfs2/file.c
··· 149 149 ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))) 150 150 return 0; 151 151 152 + /* 153 + * We can be called with no vfsmnt structure - NFSD will 154 + * sometimes do this. 155 + * 156 + * Note that our action here is different than touch_atime() - 157 + * if we can't tell whether this is a noatime mount, then we 158 + * don't know whether to trust the value of s_atime_quantum. 159 + */ 160 + if (vfsmnt == NULL) 161 + return 0; 162 + 152 163 if ((vfsmnt->mnt_flags & MNT_NOATIME) || 153 164 ((vfsmnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))) 154 165 return 0; ··· 977 966 } 978 967 979 968 ret = generic_permission(inode, mask, NULL); 980 - if (ret) 981 - mlog_errno(ret); 982 969 983 970 ocfs2_meta_unlock(inode, 0); 984 971 out: