f2fs: return error number for quota_write
Subsystems (2)
Jaegeuk Kim
maintainerPATCH 1/1 f2fs: return error number for quota_write
This patch returns an error number to quota_write in order for quota to handle it correctly.
--- fs/f2fs/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/f2fs/super.c +4 -1
@@ -1397,8 +1397,11 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type, err = a_ops->write_begin (NULL , mapping, off, tocopy,0 , &page,NULL ); -if (unlikely (err)) +if (unlikely (err)) { +if (len == towrite) +return err;break ; + } kaddr =kmap_atomic (page);memcpy (kaddr + offset, data, tocopy);
Signature · 1 line
2.14.0.rc1.383.gd1ce394fe2-goog
Hi Jaegeuk,
Quoted 2 lines · Jaegeuk Kim
This patch returns an error number to
quota_writein order for quota to handle it correctly.
We should return error number like __generic_file_write_iter, right? it needs to return written bytes if we have written one page or more, otherwise return error number feedbacked from write_begin.
So how about reverting 4f31d26b0c17 ("f2fs: return wrong error number on f2fs_quota_write")?
Thanks,
Quoted 24 lines
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)fs/f2fs/super.c +4
-1@@ -1397,8 +1397,11 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type, err = a_ops->write_begin (NULL , mapping, off, tocopy,0 , &page,NULL ); -if (unlikely (err)) +if (unlikely (err)) { +if (len == towrite) +return err;break ; + } kaddr =kmap_atomic (page);memcpy (kaddr + offset, data, tocopy);
Jaegeuk Kim
maintainerQuoted 6 lines · Chao Yu
Hi Jaegeuk,
Quoted 2 lines · Jaegeuk Kim
This patch returns an error number to
quota_writein order for quota to handle it correctly.
Quoted 6 lines
We should return error number like
__generic_file_write_iter, right? it needs to return written bytes if we have written one page or more, otherwise return error number feedbacked fromwrite_begin.So how about reverting
4f31d26b0c17("f2fs: return wrong error number onf2fs_quota_write")?
I thought like that, but realized the code change is somewhat different between them.
Thanks,
Quoted 27 lines
Thanks,
Quoted 24 lines
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)fs/f2fs/super.c +4
-1@@ -1397,8 +1397,11 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type, err = a_ops->write_begin (NULL , mapping, off, tocopy,0 , &page,NULL ); -if (unlikely (err)) +if (unlikely (err)) { +if (len == towrite) +return err;break ; + } kaddr =kmap_atomic (page);memcpy (kaddr + offset, data, tocopy);
Chao Yu
maintainerQuoted 11 lines · Jaegeuk Kim
Quoted 10 lines · Chao Yu
Hi Jaegeuk,
Quoted 2 lines · Jaegeuk Kim
This patch returns an error number to
quota_writein order for quota to handle it correctly.We should return error number like
__generic_file_write_iter, right? it needs to return written bytes if we have written one page or more, otherwise return error number feedbacked fromwrite_begin.
Quoted 5 lines
Quoted 2 lines
So how about reverting
4f31d26b0c17("f2fs: return wrong error number onf2fs_quota_write")?I thought like that, but realized the code change is somewhat different between them.
Hmm... main structure of codes here is copied from other file systems, is there the same problem in *_quota_write of other file systems?
BTW, it looks making below judgment condition being useless.
if (len == towrite) return 0;
Thanks,
Quoted 39 lines
Thanks,
Quoted 24 lines
Thanks,
Quoted 21 lines
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)fs/f2fs/super.c +4
-1@@ -1397,8 +1397,11 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type, err = a_ops->write_begin (NULL , mapping, off, tocopy,0 , &page,NULL ); -if (unlikely (err)) +if (unlikely (err)) { +if (len == towrite) +return err;break ; + }Quoted 3 lines
fs/f2fs/super.c static ssize_t f2fs_quota_write(struct super_block *sb, int type, · line 1407
Quoted 3 lines
fs/f2fs/super.c +0
-0kaddr =kmap_atomic (page);memcpy (kaddr + offset, data, tocopy);------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Jaegeuk Kim
maintainerQuoted 20 lines · Chao Yu
Quoted 11 lines · Jaegeuk Kim
Quoted 10 lines · Chao Yu
Hi Jaegeuk,
Quoted 2 lines · Jaegeuk Kim
This patch returns an error number to
quota_writein order for quota to handle it correctly.We should return error number like
__generic_file_write_iter, right? it needs to return written bytes if we have written one page or more, otherwise return error number feedbacked fromwrite_begin.Quoted 5 lines
Quoted 2 lines
So how about reverting
4f31d26b0c17("f2fs: return wrong error number onf2fs_quota_write")?I thought like that, but realized the code change is somewhat different between them.
Quoted 7 lines
Hmm... main structure of codes here is copied from other file systems, is there the same problem in
*_quota_writeof other file systems?BTW, it looks making below judgment condition being useless.
if (len == towrite) return 0;
We need this to avoid needless inode updates. :P
Thanks,
Quoted 42 lines
Thanks,
Quoted 39 lines
Thanks,
Quoted 24 lines
Thanks,
Quoted 21 lines
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)fs/f2fs/super.c +4
-1@@ -1397,8 +1397,11 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type, err = a_ops->write_begin (NULL , mapping, off, tocopy,0 , &page,NULL ); -if (unlikely (err)) +if (unlikely (err)) { +if (len == towrite) +return err;break ; + }Quoted 3 lines
fs/f2fs/super.c static ssize_t f2fs_quota_write(struct super_block *sb, int type, · line 1407
Quoted 3 lines
fs/f2fs/super.c +0
-0kaddr =kmap_atomic (page);memcpy (kaddr + offset, data, tocopy);------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 24 lines · Jaegeuk Kim
Quoted 23 lines · Chao Yu
Quoted 11 lines · Jaegeuk Kim
Quoted 10 lines · Chao Yu
Hi Jaegeuk,
Quoted 2 lines · Jaegeuk Kim
This patch returns an error number to
quota_writein order for quota to handle it correctly.We should return error number like
__generic_file_write_iter, right? it needs to return written bytes if we have written one page or more, otherwise return error number feedbacked fromwrite_begin.Quoted 5 lines
Quoted 2 lines
So how about reverting
4f31d26b0c17("f2fs: return wrong error number onf2fs_quota_write")?I thought like that, but realized the code change is somewhat different between them.
Hmm... main structure of codes here is copied from other file systems, is there the same problem in
*_quota_writeof other file systems?
Quoted 6 lines
Quoted 4 lines
BTW, it looks making below judgment condition being useless.
if (len == towrite) return 0;We need this to avoid needless inode updates. :P
For err = 0 and len == towrite case, it more likes a bug of quota that passing 0 in @len.
:(, Oh, still didn't get that why there is difference in between reverting and this fixing. Can you please explain more about this?
Thanks,
Quoted 46 lines
Thanks,
Quoted 42 lines
Thanks,
Quoted 39 lines
Thanks,
Quoted 24 lines
Thanks,
Quoted 21 lines
Signed-off-by Jaegeuk Kim <[email protected]>--- fs/f2fs/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)fs/f2fs/super.c +4
-1@@ -1397,8 +1397,11 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type, err = a_ops->write_begin (NULL , mapping, off, tocopy,0 , &page,NULL ); -if (unlikely (err)) +if (unlikely (err)) { +if (len == towrite) +return err;break ; + }Quoted 3 lines
fs/f2fs/super.c static ssize_t f2fs_quota_write(struct super_block *sb, int type, · line 1407
Quoted 3 lines
fs/f2fs/super.c +0
-0kaddr =kmap_atomic (page);memcpy (kaddr + offset, data, tocopy);------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 2 lines
.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Jaegeuk Kim
maintainerQuoted 30 lines · Chao Yu
Quoted 29 lines · Jaegeuk Kim
Quoted 27 lines · Chao Yu
Quoted 11 lines · Jaegeuk Kim
Quoted 10 lines · Chao Yu
Hi Jaegeuk,
Quoted 2 lines · Jaegeuk Kim
This patch returns an error number to
quota_writein order for quota to handle it correctly.We should return error number like
__generic_file_write_iter, right? it needs to return written bytes if we have written one page or more, otherwise return error number feedbacked fromwrite_begin.Quoted 5 lines
Quoted 2 lines
So how about reverting
4f31d26b0c17("f2fs: return wrong error number onf2fs_quota_write")?I thought like that, but realized the code change is somewhat different between them.
Hmm... main structure of codes here is copied from other file systems, is there the same problem in
*_quota_writeof other file systems?BTW, it looks making below judgment condition being useless.
if (len == towrite) return 0;
Quoted 7 lines
Quoted 1 line
We need this to avoid needless inode updates. :P
For err = 0 and len == towrite case, it more likes a bug of quota that passing 0 in @len.
:(, Oh, still didn't get that why there is difference in between reverting and this fixing. Can you please explain more about this?
Ah, right. Let me just revert the original patch. :)
Thanks,
Quoted 33 lines · Jaegeuk Kim
Quoted 32 lines · Chao Yu
Quoted 30 lines · Jaegeuk Kim
Quoted 20 lines · Chao Yu
Quoted 11 lines · Jaegeuk Kim
Quoted 10 lines · Chao Yu
Hi Jaegeuk,
Quoted 2 lines · Jaegeuk Kim
This patch returns an error number to
quota_writein order for quota to handle it correctly.We should return error number like
__generic_file_write_iter, right? it needs to return written bytes if we have written one page or more, otherwise return error number feedbacked fromwrite_begin.Quoted 5 lines
Quoted 2 lines
So how about reverting
4f31d26b0c17("f2fs: return wrong error number onf2fs_quota_write")?I thought like that, but realized the code change is somewhat different between them.
Quoted 7 lines
Hmm... main structure of codes here is copied from other file systems, is there the same problem in
*_quota_writeof other file systems?BTW, it looks making below judgment condition being useless.
if (len == towrite) return 0;We need this to avoid needless inode updates. :P
Quoted 7 lines
Quoted 5 lines
For err = 0 and len == towrite case, it more likes a bug of quota that passing 0 in @len.
:(, Oh, still didn't get that why there is difference in between reverting and this fixing. Can you please explain more about this?
Ah, right. Let me just revert the original patch. :)
Thanks,
Quoted 3 lines
Thanks,