From: Li kunyu <kunyu@nfschina.com>
To: tytso@mit.edu, adilger.kernel@dilger.ca
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
Li kunyu <kunyu@nfschina.com>
Subject: [PATCH] ext4: extents: Modify the return value variable type and initialize the assignment
Date: Thu, 9 Feb 2023 03:34:43 +0800 [thread overview]
Message-ID: <20230208193443.3055-1-kunyu@nfschina.com> (raw)
Modify the return value variable to be consistent with the return value
type of the function, and modify the initialization assignment. Under
certain circumstances, the constant return value is not required.
Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
fs/ext4/extents.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 9de1c9d1a13d..debeb2e7a162 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4676,7 +4676,7 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
struct inode *inode = file_inode(file);
loff_t new_size = 0;
unsigned int max_blocks;
- int ret = 0;
+ long ret = -EOPNOTSUPP;
int flags;
ext4_lblk_t lblk;
unsigned int blkbits = inode->i_blkbits;
@@ -4689,13 +4689,13 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
*/
if (IS_ENCRYPTED(inode) &&
(mode & (FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_INSERT_RANGE)))
- return -EOPNOTSUPP;
+ return ret;
/* Return error if mode is not supported */
if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_ZERO_RANGE |
FALLOC_FL_INSERT_RANGE))
- return -EOPNOTSUPP;
+ return ret;
inode_lock(inode);
ret = ext4_convert_inline_data(inode);
--
2.18.2
next reply other threads:[~2023-02-07 3:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 19:34 Li kunyu [this message]
2023-02-17 14:40 ` [PATCH] ext4: extents: Modify the return value variable type and initialize the assignment Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230208193443.3055-1-kunyu@nfschina.com \
--to=kunyu@nfschina.com \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox