]> Git Repo - J-linux.git/commitdiff
ext4: remove unneeded check of nr_to_submit
authorTom Rix <[email protected]>
Thu, 16 Mar 2023 20:48:31 +0000 (16:48 -0400)
committerTheodore Ts'o <[email protected]>
Thu, 20 Apr 2023 03:38:33 +0000 (23:38 -0400)
cppcheck reports
fs/ext4/page-io.c:516:51: style:
  Condition 'nr_to_submit' is always true [knownConditionTrueFalse]
 if (fscrypt_inode_uses_fs_layer_crypto(inode) && nr_to_submit) {
                                                  ^
This earlier check to bail, makes this check unncessary
/* Nothing to submit? Just unlock the page... */
if (!nr_to_submit)
return 0;

Signed-off-by: Tom Rix <[email protected]>
Fixes: dff4ac75eeee ("ext4: move keep_towrite handling to ext4_bio_write_page()")
Reviewed-by: Eric Biggers <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
fs/ext4/page-io.c

index 2e5e94219693b11b3a6baa4524a76778e557549e..3621f29ec67123e1bdf1d15556c72da8ff71a177 100644 (file)
@@ -510,7 +510,7 @@ int ext4_bio_write_folio(struct ext4_io_submit *io, struct folio *folio,
         * (e.g. holes) to be unnecessarily encrypted, but this is rare and
         * can't happen in the common case of blocksize == PAGE_SIZE.
         */
-       if (fscrypt_inode_uses_fs_layer_crypto(inode) && nr_to_submit) {
+       if (fscrypt_inode_uses_fs_layer_crypto(inode)) {
                gfp_t gfp_flags = GFP_NOFS;
                unsigned int enc_bytes = round_up(len, i_blocksize(inode));
                struct page *bounce_page;
This page took 0.050347 seconds and 4 git commands to generate.