diff options
author | Eric Biggers <ebiggers@google.com> | 2021-01-12 11:02:48 -0800 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2021-01-13 17:26:35 +0100 |
commit | a38ed483a72672ee6bdb5d8cf17fc0838377baa0 (patch) | |
tree | bd94a33a5a7f45e4c5843a225b7247c54371c63b /fs/fs-writeback.c | |
parent | e2728c5621fd9c68c65a6647875a1d1c67b9f257 (diff) | |
download | linux-a38ed483a72672ee6bdb5d8cf17fc0838377baa0.tar.gz linux-a38ed483a72672ee6bdb5d8cf17fc0838377baa0.tar.bz2 linux-a38ed483a72672ee6bdb5d8cf17fc0838377baa0.zip |
fs: pass only I_DIRTY_INODE flags to ->dirty_inode
->dirty_inode is now only called when I_DIRTY_INODE (I_DIRTY_SYNC and/or
I_DIRTY_DATASYNC) is set. However it may still be passed other dirty
flags at the same time, provided that these other flags happened to be
passed to __mark_inode_dirty() at the same time as I_DIRTY_INODE.
This doesn't make sense because there is no reason for filesystems to
care about these extra flags. Nor are filesystems notified about all
updates to these other flags.
Therefore, mask the flags before passing them to ->dirty_inode.
Also properly document ->dirty_inode in vfs.rst.
Link: https://lore.kernel.org/r/20210112190253.64307-7-ebiggers@kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r-- | fs/fs-writeback.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index b7616bbd5533..2e6064012f7d 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -2259,7 +2259,7 @@ void __mark_inode_dirty(struct inode *inode, int flags) trace_writeback_dirty_inode_start(inode, flags); if (sb->s_op->dirty_inode) - sb->s_op->dirty_inode(inode, flags); + sb->s_op->dirty_inode(inode, flags & I_DIRTY_INODE); trace_writeback_dirty_inode(inode, flags); |