f2fs: use parameter max_items instead of PIDVEC_SIZE
PATCH 1/2 f2fs: use parameter max_items instead of PIDVEC_SIZE
--- fs/f2fs/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/trace.c +1 -1
@@ -138,7 +138,7 @@ static unsigned int gang_lookup_pids(pid_t *results, unsigned long first_index,radix_tree_for_each_slot (slot, &pids, &iter, first_index) { results[ret] = iter.index; -if (++ret ==PIDVEC_SIZE ) +if (++ret == max_items)break ; }return ret;
Signature · 9 lines
2.10.1 ------------------------------------------------------------------------------ Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition. http://sdm.link/oxford
PATCH 2/2 f2fs: check range before defragment
This patch checks the parameter range passed by ioctl to void that range exceeds the max_file_blocks limit.
--- fs/f2fs/file.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/f2fs/file.c +6 -0
@@ -2045,6 +2045,12 @@ static int f2fs_ioc_defragment(struct file *filp, unsigned long arg) goto out; } +if (unlikely ((range.start + range.len) >>PAGE_SHIFT > + sbi->max_file_blocks)) { + err = -EINVAL ; + goto out; + } + err =f2fs_defragment_range (sbi, filp, &range);f2fs_update_time (sbi,REQ_TIME );if (err <0 )
Signature · 9 lines
2.10.1 ------------------------------------------------------------------------------ Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition. http://sdm.link/oxford
Re: [PATCH 2/2] f2fs: check range before defragment
Quoted 4 lines · Sheng Yong
This patch checks the parameter range passed by ioctl to void that range exceeds the
max_file_blockslimit.Signed-off-by Sheng Yong <[email protected]>
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition.
http://sdm.link/oxford
Quoted 1 line · Sheng Yong
Signed-off-by Sheng Yong <[email protected]>
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition.
http://sdm.link/oxford