summaryrefslogtreecommitdiff
path: root/fs/gfs2/file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-09-22 00:42:59 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-22 00:42:59 +0300
commitf7c3bf8fa7e5a8e45f4a8e82be6466157854b59b (patch)
treeace565b119da1c379f4873d38c205eac7740a6d3 /fs/gfs2/file.c
parentfbc246a12aac27f7b25a37f9398bb3bc552cec92 (diff)
parentf0b444b349e33ae0d3dd93e25ca365482a5d17d4 (diff)
downloadlinux-f7c3bf8fa7e5a8e45f4a8e82be6466157854b59b.tar.xz
Merge tag 'gfs2-for-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2
Pull gfs2 updates from Andreas Gruenbacher: - Use asynchronous glocks and timeouts to recover from deadlocks during rename and exchange: the lock ordering constraints the vfs uses are not sufficient to prevent deadlocks across multiple nodes. - Add support for IOMAP_ZERO and use iomap_zero_range to replace gfs2 specific code. - Various other minor fixes and cleanups. * tag 'gfs2-for-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: clear buf_in_tr when ending a transaction in sweep_bh_for_rgrps gfs2: Improve mmap write vs. truncate consistency gfs2: Use async glocks for rename gfs2: create function gfs2_glock_update_hold_time gfs2: separate holder for rgrps in gfs2_rename gfs2: Delete an unnecessary check before brelse() gfs2: Minor PAGE_SIZE arithmetic cleanups gfs2: Fix recovery slot bumping gfs2: Fix possible fs name overflows gfs2: untangle the logic in gfs2_drevalidate gfs2: Always mark inode dirty in fallocate gfs2: Minor gfs2_alloc_inode cleanup gfs2: implement gfs2_block_zero_range using iomap_zero_range gfs2: Add support for IOMAP_ZERO gfs2: gfs2_iomap_begin cleanup
Diffstat (limited to 'fs/gfs2/file.c')
-rw-r--r--fs/gfs2/file.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 52fa1ef8400b..997b326247e2 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -1049,7 +1049,7 @@ static long __gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t
rblocks += data_blocks ? data_blocks : 1;
error = gfs2_trans_begin(sdp, rblocks,
- PAGE_SIZE/sdp->sd_sb.sb_bsize);
+ PAGE_SIZE >> inode->i_blkbits);
if (error)
goto out_trans_fail;
@@ -1065,11 +1065,10 @@ static long __gfs2_fallocate(struct file *file, int mode, loff_t offset, loff_t
gfs2_quota_unlock(ip);
}
- if (!(mode & FALLOC_FL_KEEP_SIZE) && (pos + count) > inode->i_size) {
+ if (!(mode & FALLOC_FL_KEEP_SIZE) && (pos + count) > inode->i_size)
i_size_write(inode, pos + count);
- file_update_time(file);
- mark_inode_dirty(inode);
- }
+ file_update_time(file);
+ mark_inode_dirty(inode);
if ((file->f_flags & O_DSYNC) || IS_SYNC(file->f_mapping->host))
return vfs_fsync_range(file, pos, pos + count - 1,