Skip to content

Commit 8ae56b4

Browse files
Tom Rixtytso
authored andcommitted
ext4: remove unneeded check of nr_to_submit
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: dff4ac7 ("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]>
1 parent 5490209 commit 8ae56b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/page-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ int ext4_bio_write_folio(struct ext4_io_submit *io, struct folio *folio,
510510
* (e.g. holes) to be unnecessarily encrypted, but this is rare and
511511
* can't happen in the common case of blocksize == PAGE_SIZE.
512512
*/
513-
if (fscrypt_inode_uses_fs_layer_crypto(inode) && nr_to_submit) {
513+
if (fscrypt_inode_uses_fs_layer_crypto(inode)) {
514514
gfp_t gfp_flags = GFP_NOFS;
515515
unsigned int enc_bytes = round_up(len, i_blocksize(inode));
516516
struct page *bounce_page;

0 commit comments

Comments
 (0)