ext4: check for shutdown and r/o file system in ext4_write_inode()

commit 18f2c4fceb upstream.

If the file system has been shut down or is read-only, then
ext4_write_inode() needs to bail out early.

Also use jbd2_complete_transaction() instead of ext4_force_commit() so
we only force a commit if it is needed.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
[bwh: Backported to 3.16:
 - Open-code sb_rdonly()
 - Drop ext4_forced_shutdown() check]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Theodore Ts'o 2018-12-19 14:36:58 -05:00 • committed by Ben Hutchings
commit 607ac35fcd