aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 93f16c5e8a8e..7b93df9aa182 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4427,21 +4427,20 @@ out_brelse:
4427 * 4427 *
4428 * We are called from a few places: 4428 * We are called from a few places:
4429 * 4429 *
4430 * - Within generic_file_write() for O_SYNC files. 4430 * - Within generic_file_aio_write() -> generic_write_sync() for O_SYNC files.
4431 * Here, there will be no transaction running. We wait for any running 4431 * Here, there will be no transaction running. We wait for any running
4432 * transaction to commit. 4432 * transaction to commit.
4433 * 4433 *
4434 * - Within sys_sync(), kupdate and such. 4434 * - Within flush work (sys_sync(), kupdate and such).
4435 * We wait on commit, if tol to. 4435 * We wait on commit, if told to.
4436 * 4436 *
4437 * - Within prune_icache() (PF_MEMALLOC == true) 4437 * - Within iput_final() -> write_inode_now()
4438 * Here we simply return. We can't afford to block kswapd on the 4438 * We wait on commit, if told to.
4439 * journal commit.
4440 * 4439 *
4441 * In all cases it is actually safe for us to return without doing anything, 4440 * In all cases it is actually safe for us to return without doing anything,
4442 * because the inode has been copied into a raw inode buffer in 4441 * because the inode has been copied into a raw inode buffer in
4443 * ext4_mark_inode_dirty(). This is a correctness thing for O_SYNC and for 4442 * ext4_mark_inode_dirty(). This is a correctness thing for WB_SYNC_ALL
4444 * knfsd. 4443 * writeback.
4445 * 4444 *
4446 * Note that we are absolutely dependent upon all inode dirtiers doing the 4445 * Note that we are absolutely dependent upon all inode dirtiers doing the
4447 * right thing: they *must* call mark_inode_dirty() after dirtying info in 4446 * right thing: they *must* call mark_inode_dirty() after dirtying info in
@@ -4453,15 +4452,15 @@ out_brelse:
4453 * stuff(); 4452 * stuff();
4454 * inode->i_size = expr; 4453 * inode->i_size = expr;
4455 * 4454 *
4456 * is in error because a kswapd-driven write_inode() could occur while 4455 * is in error because write_inode() could occur while `stuff()' is running,
4457 * `stuff()' is running, and the new i_size will be lost. Plus the inode 4456 * and the new i_size will be lost. Plus the inode will no longer be on the
4458 * will no longer be on the superblock's dirty inode list. 4457 * superblock's dirty inode list.
4459 */ 4458 */
4460int ext4_write_inode(struct inode *inode, struct writeback_control *wbc) 4459int ext4_write_inode(struct inode *inode, struct writeback_control *wbc)
4461{ 4460{
4462 int err; 4461 int err;
4463 4462
4464 if (current->flags & PF_MEMALLOC) 4463 if (WARN_ON_ONCE(current->flags & PF_MEMALLOC))
4465 return 0; 4464 return 0;
4466 4465
4467 if (EXT4_SB(inode->i_sb)->s_journal) { 4466 if (EXT4_SB(inode->i_sb)->s_journal) {