Re: [PATCH] kernel/sysctl.c: If count including the terminating byte '\0' the write system call should retrun success.

2015-08-24 Thread Sean Fu
On Mon, Aug 24, 2015 at 8:27 PM, Eric W. Biederman ebied...@xmission.com wrote: On August 24, 2015 1:56:13 AM PDT, Sean Fu fxinr...@gmail.com wrote: when the input argument count including the terminating byte \0, The write system call return EINVAL on proc file. But it return success

[PATCH] kernel/sysctl.c: If count including the terminating byte '\0' the write system call should retrun success.

2015-08-24 Thread Sean Fu
when the input argument count including the terminating byte \0, The write system call return EINVAL on proc file. But it return success on regular file. E.g. Writting two bytes (1\0) to /proc/sys/net/ipv4/conf/eth0/rp_filter. write(fd, 1\0, 2) return EINVAL. Signed-off-by: Sean Fu fxinr

Re: [PATCH] kernel/sysctl.c: If count including the terminating byte '\0' the write system call should retrun success.

2015-08-24 Thread Sean Fu
, errno=%d, %s\n, fd, len, errno, strerror(errno)); close(fd); return 0; } On Tue, Aug 25, 2015 at 12:59 AM, Steven Rostedt rost...@goodmis.org wrote: On Mon, 24 Aug 2015 16:56:13 +0800 Sean Fu fxinr...@gmail.com wrote: when the input argument count including the terminating

Re: [PATCH] kernel/sysctl.c: If count including the terminating byte '\0' the write system call should retrun success.

2015-08-25 Thread Sean Fu
On Tue, Aug 25, 2015 at 10:15 PM, Steven Rostedt rost...@goodmis.org wrote: On Tue, 25 Aug 2015 15:50:18 +0800 Sean Fu fxinr...@gmail.com wrote: On Tue, Aug 25, 2015 at 10:24 AM, Eric W. Biederman ebied...@xmission.com wrote: On August 24, 2015 6:57:57 PM MDT, Sean Fu fxinr...@gmail.com

Re: [PATCH] kernel/sysctl.c: If count including the terminating byte '\0' the write system call should retrun success.

2015-08-26 Thread Sean Fu
On Wed, Aug 26, 2015 at 3:05 AM, Steven Rostedt rost...@goodmis.org wrote: On Tue, 25 Aug 2015 13:33:57 -0400 Austin S Hemmelgarn ahferro...@gmail.com wrote: How do you know that? I will prove that all other write usage is not impacted later. Except that you can only really do this for

Re: [PATCH] kernel/sysctl.c: If count including the terminating byte '\0' the write system call should retrun success.

2015-08-27 Thread Sean Fu
On Thu, Aug 27, 2015 at 4:32 PM, Sean Fu fxinr...@gmail.com wrote: On Thu, Aug 27, 2015 at 10:32 AM, Steven Rostedt rost...@goodmis.org wrote: On Thu, 27 Aug 2015 08:17:29 +0800 Sean Fu fxinr...@gmail.com wrote: On Thu, Aug 27, 2015 at 4:36 AM, Steven Rostedt rost...@goodmis.org wrote

Re: [PATCH] kernel/sysctl.c: If count including the terminating byte '\0' the write system call should retrun success.

2015-08-26 Thread Sean Fu
On Wed, Aug 26, 2015 at 4:39 AM, Heinrich Schuchardt xypron.g...@gmx.de wrote: On 24.08.2015 10:56, Sean Fu wrote: when the input argument count including the terminating byte \0, The write system call return EINVAL on proc file. But it return success on regular file. E.g. Writting two

Re: [PATCH] kernel/sysctl.c: If count including the terminating byte '\0' the write system call should retrun success.

2015-08-25 Thread Sean Fu
On Tue, Aug 25, 2015 at 10:24 AM, Eric W. Biederman ebied...@xmission.com wrote: On August 24, 2015 6:57:57 PM MDT, Sean Fu fxinr...@gmail.com wrote: An application from HuaWei which works fine on 2.6 encounters this issue on 3.0 or later kernel. My sympathies. Being stuck with a 3rd party

Re: [PATCH] kernel/sysctl.c: If count including the terminating byte '\0' the write system call should retrun success.

2015-08-24 Thread Sean Fu
linux-8lij:~ # gcc ./proc_test.c -o ./proc_test linux-8lij:~ # ./proc_test eth7 Input: ./proc_test, eth7 file is: /proc/sys/net/ipv4/conf/eth7/rp_filter. open /proc/sys/net/ipv4/conf/eth7/rp_filter ok, fd=3 write 3: len=1, errno=0, Success On Tue, Aug 25, 2015 at 8:57 AM, Sean Fu fxinr...@gmail.com

Re: [PATCH] kernel/sysctl.c: If count including the terminating byte '\0' the write system call should retrun success.

2015-08-26 Thread Sean Fu
On Wed, Aug 26, 2015 at 4:39 AM, Heinrich Schuchardt xypron.g...@gmx.de wrote: On 24.08.2015 10:56, Sean Fu wrote: when the input argument count including the terminating byte \0, The write system call return EINVAL on proc file. But it return success on regular file. E.g. Writting two

Re: [PATCH] kernel/sysctl.c: If count including the terminating byte '\0' the write system call should retrun success.

2015-08-26 Thread Sean Fu
On Thu, Aug 27, 2015 at 4:36 AM, Steven Rostedt rost...@goodmis.org wrote: On Wed, 26 Aug 2015 23:48:01 +0800 Sean Fu fxinr...@gmail.com wrote: Defending the patch, I can't imagine any user space code expecting the current behavior. The current behavior is that if you write 1\0

Re: [PATCH] kernel/sysctl.c: If count including the terminating byte '\0' the write system call should retrun success.

2015-08-27 Thread Sean Fu
On Thu, Aug 27, 2015 at 10:32 AM, Steven Rostedt rost...@goodmis.org wrote: On Thu, 27 Aug 2015 08:17:29 +0800 Sean Fu fxinr...@gmail.com wrote: On Thu, Aug 27, 2015 at 4:36 AM, Steven Rostedt rost...@goodmis.org wrote: On Wed, 26 Aug 2015 23:48:01 +0800 Sean Fu fxinr...@gmail.com wrote

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-09-07 Thread Sean Fu
On Fri, Aug 28, 2015 at 11:31 AM, Sean Fu <fxinr...@gmail.com> wrote: > On Thu, Aug 27, 2015 at 4:32 PM, Sean Fu <fxinr...@gmail.com> wrote: >> On Thu, Aug 27, 2015 at 10:32 AM, Steven Rostedt <rost...@goodmis.org> wrote: >>> On Thu, 27 Aug 2015 08:17:29 +

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-09-13 Thread Sean Fu
On Sat, Sep 12, 2015 at 1:01 AM, Eric W. Biederman <ebied...@xmission.com> wrote: > Sean Fu <fxinr...@gmail.com> writes: > >>> Sounds like a reasonable compromise. Sean, can you make a patch that >>> only affects the one proc file (comment it well in the code),

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-09-11 Thread Sean Fu
On Wed, Sep 9, 2015 at 12:36 AM, Steven Rostedt wrote: > On Tue, 08 Sep 2015 11:19:14 -0500 > ebied...@xmission.com (Eric W. Biederman) wrote: > > >> This patch does not implement the old behavior. >> >> The old code does use '\0' as a buffer terminator, and because it does

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-09-15 Thread Sean Fu
.@goodmis.org> wrote: > On Sun, 13 Sep 2015 20:39:31 +0800 > Sean Fu <fxinr...@gmail.com> wrote: > > >> > Accepting a '\0' is not at all reasonable for a text interface. The >> > application that does it is buggy. >> It is hard to comprehend that the

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-09-15 Thread Sean Fu
On Mon, Sep 14, 2015 at 12:44 AM, Eric W. Biederman <ebied...@xmission.com> wrote: > Sean Fu <fxinr...@gmail.com> writes: > >> On Sat, Sep 12, 2015 at 1:01 AM, Eric W. Biederman >> <ebied...@xmission.com> wrote: >>> Sean Fu <fxinr...@gmail.com

Fail to build tools/all

2016-04-30 Thread Sean Fu
Hi guys: I encountered a build error when running "make V=1 tools/all". Shall we write a patch to fix it? The following is error log. start == commit 05cf8077e54b20dddb756eaa26f3aeb5c38dd3cf Merge: cf78031 db5dd0d

Re: Fail to build tools/all

2016-05-02 Thread Sean Fu
On Mon, May 02, 2016 at 12:20:08PM +0200, Thomas Renninger wrote: > On Sunday, May 01, 2016 01:11:33 PM Sean Fu wrote: > > Hi guys: > > I encountered a build error when running "make V=1 tools/all". > > Shall we write a patch to

Re: [PATCH] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.

2016-09-06 Thread Sean Fu
On Mon, Sep 05, 2016 at 03:56:41PM +0800, Qu Wenruo wrote: > > > At 09/05/2016 09:19 AM, Zhao Lei wrote: > >Hi, Sean Fu > > > >>From: Sean Fu [mailto:fxinr...@gmail.com] > >>Sent: Sunday, September 04, 2016 7:54 PM > >>To: dste...@suse.com &

Re: [PATCH v2] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.

2016-09-06 Thread Sean Fu
On Tue, Sep 06, 2016 at 01:19:39PM +0800, Zhao Lei wrote: > Hi, Sean Fu > > > -Original Message- > > From: Sean Fu [mailto:fxinr...@gmail.com] > > Sent: Tuesday, September 06, 2016 11:51 AM > > To: dste...@suse.com > > Cc: c...@fb.com; anand.j...@ora

Re: [PATCH] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.

2016-09-06 Thread Sean Fu
On Tue, Sep 06, 2016 at 11:12:20AM -0400, Jeff Mahoney wrote: > On 9/6/16 5:58 AM, David Sterba wrote: > > On Mon, Sep 05, 2016 at 11:13:40PM -0400, Jeff Mahoney wrote: > Since root is only used to get fs_info->chunk_root, why not use fs_info > directly? > >>> > >>> Weird. Exactly this

Re: [PATCH] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.

2016-09-10 Thread Sean Fu
On Thu, Sep 08, 2016 at 11:25:48PM -0400, Jeff Mahoney wrote: > On 9/8/16 11:08 PM, Sean Fu wrote: > > On Tue, Sep 06, 2016 at 11:12:20AM -0400, Jeff Mahoney wrote: > >> On 9/6/16 5:58 AM, David Sterba wrote: > >>> On Mon, Sep 05, 2016 at 11:13:40PM -0400, Jeff Maho

Re: [PATCH] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.

2016-09-08 Thread Sean Fu
On Tue, Sep 06, 2016 at 11:12:20AM -0400, Jeff Mahoney wrote: > On 9/6/16 5:58 AM, David Sterba wrote: > > On Mon, Sep 05, 2016 at 11:13:40PM -0400, Jeff Mahoney wrote: > Since root is only used to get fs_info->chunk_root, why not use fs_info > directly? > >>> > >>> Weird. Exactly this

Re: [PATCH] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.

2016-09-08 Thread Sean Fu
On Thu, Sep 08, 2016 at 11:25:48PM -0400, Jeff Mahoney wrote: > On 9/8/16 11:08 PM, Sean Fu wrote: > > On Tue, Sep 06, 2016 at 11:12:20AM -0400, Jeff Mahoney wrote: > >> On 9/6/16 5:58 AM, David Sterba wrote: > >>> On Mon, Sep 05, 2016 at 11:13:40PM -0400, Jeff Maho

[PATCH] fs: buffer: Modify alloc_page_buffers.

2017-06-19 Thread Sean Fu
Make alloc_page_buffers support circular buffer list and initialise b_state field. Optimize the performance by removing the buffer list traversal to create circular buffer list. Signed-off-by: Sean Fu <fxinr...@gmail.com> --- drivers/md/bitmap.c | 2 +- fs/buffer.c

Re: [PATCH] fs: buffer: Modify alloc_page_buffers.

2017-06-23 Thread Sean Fu
On Mon, Jun 19, 2017 at 05:03:16PM +0100, Al Viro wrote: > On Mon, Jun 19, 2017 at 09:01:36PM +0800, Sean Fu wrote: > > Make alloc_page_buffers support circular buffer list and initialise > > b_state field. > > Optimize the performance by removing the buffer list traversal t

Re: [PATCH] fs: buffer: Modify alloc_page_buffers.

2017-06-21 Thread Sean Fu
On Mon, Jun 19, 2017 at 05:03:16PM +0100, Al Viro wrote: > On Mon, Jun 19, 2017 at 09:01:36PM +0800, Sean Fu wrote: > > Make alloc_page_buffers support circular buffer list and initialise > > b_state field. > > Optimize the performance by removing the buffer list traversal t

Re: [PATCH] fs/buffer.c: make bh_lru_install() more efficient

2017-06-03 Thread Sean Fu
On Sat, Mar 25, 2017 at 08:34:30PM -0700, Eric Biggers wrote: > On Thu, Dec 29, 2016 at 01:34:45PM -0600, Eric Biggers wrote: > > From: Eric Biggers > > > > To install a buffer_head into the cpu's LRU queue, bh_lru_install() > > would construct a new copy of the queue and

[PATCH 2/2] x86: Fix off-by-one error in loop termination.

2017-09-10 Thread Sean Fu
An off-by-one error in loop terminantion conditions in create_setup_data_nodes will lead to memory leak when create_setup_data_node return error. Signed-off-by: Sean Fu <fxinr...@gmail.com> --- arch/x86/kernel/ksysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ar

Re: [PATCH] x86: Fix off-by-one error in loop termination.

2017-09-10 Thread Sean Fu
On Mon, Sep 11, 2017 at 08:33:21AM +0800, Sean Fu wrote: > An off-by-one error in loop terminantion conditions in > create_setup_data_nodes will lead to memory leak when > create_setup_data_node return error. > > Signed-off-by: Sean Fu <fxinr...@gmail.com> > --- > a

[PATCH] x86: Fix off-by-one error in loop termination.

2017-09-10 Thread Sean Fu
An off-by-one error in loop terminantion conditions in create_setup_data_nodes will lead to memory leak when create_setup_data_node return error. Signed-off-by: Sean Fu <fxinr...@gmail.com> --- arch/x86/kernel/ksysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ar

[PATCH] fs: buffer: Remove unnecessary initialisation for bh->b_state.

2017-12-20 Thread Sean Fu
The memory is allocated by kmem_cache_zalloc and initialized with zero. The bh->b_state initialisation is unnecessary in nobh_write_begin. Signed-off-by: Sean Fu <fxinr...@gmail.com> --- fs/buffer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c inde

Re: [PATCH] ext4: Remove repeated test in ext4_file_read_iter.

2018-01-10 Thread Sean Fu
On Wed, Jan 03, 2018 at 02:08:05AM +, Al Viro wrote: > On Wed, Dec 27, 2017 at 04:19:58PM +0800, Sean Fu wrote: > > generic_file_read_iter has done the count test. > > So ext4_file_read_iter don't need to test the count repeatedly. > > Huh? You do realize that g

Re: [PATCH] ext4: Remove repeated test in ext4_file_read_iter.

2018-01-16 Thread Sean Fu
On Wed, Jan 10, 2018 at 03:02:55PM -0500, Theodore Ts'o wrote: > On Wed, Jan 10, 2018 at 10:01:49PM +0800, Sean Fu wrote: > > > > Correct, IOCB_NOWAIT read with zero count can return -EAGAIN, But I > > think that it is reasonable. while it got lock, zero would be retu

[PATCH] ext4: Remove unnecessary NULL checks in ext4.

2018-02-06 Thread Sean Fu
NULL check is done in kmem_cache_destroy. So remove NULL checks in ext4. Signed-off-by: Sean Fu <fxinr...@gmail.com> --- fs/ext4/extents_status.c | 3 +-- fs/ext4/mballoc.c| 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ext4/extents_status.c b/f

[PATCH 2/3] fs/ntfs: Make ntfs to support circular buffer list.

2018-01-01 Thread Sean Fu
Modify mark_ntfs_record_dirty to support circular buffer list. alloc_page_buffers created circular buffer list. So the circular list linking in ntfs_sync_mft_mirror is unnecessary. Signed-off-by: Sean Fu <fxinr...@gmail.com> --- fs/ntfs/aops.c | 6 ++ fs/ntfs/mft.c | 4 2 files c

[PATCH 0/3] Create circular buffer list for every page instead of linear list.

2018-01-01 Thread Sean Fu
buffer list. Modify write_page free_buffers and read_page to support circular buffer list. Sean Fu (3): fs: buffer: Create circular buffer list for pages. fs/ntfs: Make ntfs to support circular buffer list. md: bitmap: Support circular buffer list. drivers/md/md-bitmap.c | 36

[PATCH 1/3] fs: buffer: Create circular buffer list for pages.

2018-01-01 Thread Sean Fu
Make alloc_page_buffers to create circular buffer list instead linear list. Remove unnecessary traversal in link_dev_buffers to create circular buffer list. Make nobh_write_begin and nobh_write_end to support circular buffer list traversal. Signed-off-by: Sean Fu <fxinr...@gmail.com> -

[PATCH 3/3] md: bitmap: Support circular buffer list.

2018-01-01 Thread Sean Fu
Modify write_page free_buffers and read_page to support circular buffer list. Signed-off-by: Sean Fu <fxinr...@gmail.com> --- drivers/md/md-bitmap.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/drivers/md/md-bitmap.c b/drivers

Re: [PATCH 3/3] md: bitmap: Support circular buffer list.

2018-01-01 Thread Sean Fu
On Tue, Jan 02, 2018 at 02:54:49PM +0800, Sean Fu wrote: > Modify write_page free_buffers and read_page to support circular buffer > list. > > Signed-off-by: Sean Fu <fxinr...@gmail.com> > --- > drivers/md/md-bitmap.c | 36 +++- > 1

[PATCH] ext4: Remove repeated test in ext4_file_read_iter.

2017-12-27 Thread Sean Fu
generic_file_read_iter has done the count test. So ext4_file_read_iter don't need to test the count repeatedly. Signed-off-by: Sean Fu <fxinr...@gmail.com> --- fs/ext4/file.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/ext4/file.c b/fs/ext4/file.c index a0ae27b..87ca13e

Re: [PATCH] fs/buffer.c: Optimize grow_buffer function.

2018-08-08 Thread Sean Fu
On Sat, Jul 21, 2018 at 07:21:16PM +0100, Al Viro wrote: > On Sun, Jul 22, 2018 at 01:30:17AM +0800, Sean Fu wrote: > > Use PAGE_SHIFT and i_blkbits of bd_inode directly to avoid ugly sizebits > > calculation. > > Remove ugly sizebits calculation. > > Remove unn

Re: [PATCH] md/bcache: Remove NULL check.

2018-08-13 Thread Sean Fu
On Mon, Aug 13, 2018 at 06:00:11PM +0800, Coly Li wrote: > On 2018/8/13 5:38 PM, Sean Fu wrote: > > Remove unnessesary NULL check before kmem_cache_destroy() in > > drivers/md/bcache/request.c > > > > Signed-off-by: Sean Fu > > Hi Sean, > > A same cha

[PATCH] md/bcache: Remove NULL check.

2018-08-13 Thread Sean Fu
Remove unnessesary NULL check before kmem_cache_destroy() in drivers/md/bcache/request.c Signed-off-by: Sean Fu --- drivers/md/bcache/request.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index ae67f5f..0ddee35

Re: [PATCH] fs/buffer.c: Optimize grow_buffer function.

2018-07-24 Thread Sean Fu
On Sat, Jul 21, 2018 at 07:21:16PM +0100, Al Viro wrote: > On Sun, Jul 22, 2018 at 01:30:17AM +0800, Sean Fu wrote: > > Use PAGE_SHIFT and i_blkbits of bd_inode directly to avoid ugly sizebits > > calculation. > > Remove ugly sizebits calculation. > > Remove unn

[PATCH] fs/buffer.c: Optimize grow_buffer function.

2018-07-21 Thread Sean Fu
bss dec hex filename 340371510 16 355638aeb fs/buffer.o After: sean@linux-zmni:~/sda5/source/linus_repo/linux> size fs/buffer.o textdata bss dec hex filename 340211510 16 355478adb fs/buffer.o Signed-off-by: Sean Fu --- fs/buffer.

Re: [PATCH] ext4: Remove repeated test in ext4_file_read_iter.

2018-01-10 Thread Sean Fu
On Wed, Jan 03, 2018 at 02:08:05AM +, Al Viro wrote: > On Wed, Dec 27, 2017 at 04:19:58PM +0800, Sean Fu wrote: > > generic_file_read_iter has done the count test. > > So ext4_file_read_iter don't need to test the count repeatedly. > > Huh? You do realize that g

[PATCH] fs: buffer: Remove unnecessary initialisation for bh->b_state.

2017-12-20 Thread Sean Fu
The memory is allocated by kmem_cache_zalloc and initialized with zero. The bh->b_state initialisation is unnecessary in nobh_write_begin. Signed-off-by: Sean Fu --- fs/buffer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index 0736a6a..e9a1861 100644 --- a

[PATCH] ext4: Remove repeated test in ext4_file_read_iter.

2017-12-27 Thread Sean Fu
generic_file_read_iter has done the count test. So ext4_file_read_iter don't need to test the count repeatedly. Signed-off-by: Sean Fu --- fs/ext4/file.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/ext4/file.c b/fs/ext4/file.c index a0ae27b..87ca13e 100644 --- a/fs/ext4/file.c

[PATCH] ext4: Remove unnecessary NULL checks in ext4.

2018-02-06 Thread Sean Fu
NULL check is done in kmem_cache_destroy. So remove NULL checks in ext4. Signed-off-by: Sean Fu --- fs/ext4/extents_status.c | 3 +-- fs/ext4/mballoc.c| 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c index

[PATCH 2/3] fs/ntfs: Make ntfs to support circular buffer list.

2018-01-01 Thread Sean Fu
Modify mark_ntfs_record_dirty to support circular buffer list. alloc_page_buffers created circular buffer list. So the circular list linking in ntfs_sync_mft_mirror is unnecessary. Signed-off-by: Sean Fu --- fs/ntfs/aops.c | 6 ++ fs/ntfs/mft.c | 4 2 files changed, 2 insertions(+), 8

[PATCH 0/3] Create circular buffer list for every page instead of linear list.

2018-01-01 Thread Sean Fu
buffer list. Modify write_page free_buffers and read_page to support circular buffer list. Sean Fu (3): fs: buffer: Create circular buffer list for pages. fs/ntfs: Make ntfs to support circular buffer list. md: bitmap: Support circular buffer list. drivers/md/md-bitmap.c | 36

[PATCH 1/3] fs: buffer: Create circular buffer list for pages.

2018-01-01 Thread Sean Fu
Make alloc_page_buffers to create circular buffer list instead linear list. Remove unnecessary traversal in link_dev_buffers to create circular buffer list. Make nobh_write_begin and nobh_write_end to support circular buffer list traversal. Signed-off-by: Sean Fu --- fs/buffer.c | 48

[PATCH 3/3] md: bitmap: Support circular buffer list.

2018-01-01 Thread Sean Fu
Modify write_page free_buffers and read_page to support circular buffer list. Signed-off-by: Sean Fu --- drivers/md/md-bitmap.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index

Re: [PATCH 3/3] md: bitmap: Support circular buffer list.

2018-01-01 Thread Sean Fu
On Tue, Jan 02, 2018 at 02:54:49PM +0800, Sean Fu wrote: > Modify write_page free_buffers and read_page to support circular buffer > list. > > Signed-off-by: Sean Fu > --- > drivers/md/md-bitmap.c | 36 +++- > 1 file changed, 19 insert

Re: [PATCH] fs/buffer.c: make bh_lru_install() more efficient

2017-06-03 Thread Sean Fu
On Sat, Mar 25, 2017 at 08:34:30PM -0700, Eric Biggers wrote: > On Thu, Dec 29, 2016 at 01:34:45PM -0600, Eric Biggers wrote: > > From: Eric Biggers > > > > To install a buffer_head into the cpu's LRU queue, bh_lru_install() > > would construct a new copy of the queue and then memcpy it over the

[PATCH 2/2] x86: Fix off-by-one error in loop termination.

2017-09-10 Thread Sean Fu
An off-by-one error in loop terminantion conditions in create_setup_data_nodes will lead to memory leak when create_setup_data_node return error. Signed-off-by: Sean Fu --- arch/x86/kernel/ksysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/ksysfs.c b

[PATCH] x86: Fix off-by-one error in loop termination.

2017-09-10 Thread Sean Fu
An off-by-one error in loop terminantion conditions in create_setup_data_nodes will lead to memory leak when create_setup_data_node return error. Signed-off-by: Sean Fu --- arch/x86/kernel/ksysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/ksysfs.c b

Re: [PATCH] x86: Fix off-by-one error in loop termination.

2017-09-10 Thread Sean Fu
On Mon, Sep 11, 2017 at 08:33:21AM +0800, Sean Fu wrote: > An off-by-one error in loop terminantion conditions in > create_setup_data_nodes will lead to memory leak when > create_setup_data_node return error. > > Signed-off-by: Sean Fu > --- > arch/x86/kernel/ksysfs.c | 2

Re: [PATCH] ext4: Remove repeated test in ext4_file_read_iter.

2018-01-16 Thread Sean Fu
On Wed, Jan 10, 2018 at 03:02:55PM -0500, Theodore Ts'o wrote: > On Wed, Jan 10, 2018 at 10:01:49PM +0800, Sean Fu wrote: > > > > Correct, IOCB_NOWAIT read with zero count can return -EAGAIN, But I > > think that it is reasonable. while it got lock, zero would be retu

[PATCH] workqueue: Use IS_ERR and PTR_ERR instead of PTR_ERR_OR_ZERO to remove redundant definitions and checks.

2020-04-28 Thread Sean Fu
Reduce code size. Before: textdata bss dec hex filename 475105979 840 54329d439 kernel/workqueue.o After: textdata bss dec hex filename 474745979 840 54293d415 kernel/workqueue.o Signed-off-by: Sean Fu --- kernel/workqueue.c

[PATCH v2] workqueue: Use IS_ERR and PTR_ERR instead of PTR_ERR_OR_ZERO.

2020-04-28 Thread Sean Fu
filename 474745979 840 54293d415 kernel/workqueue.o Signed-off-by: Sean Fu --- Changes in v2: - make commit message more clear. kernel/workqueue.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index

[PATCH] md/bcache: Remove NULL check.

2018-08-13 Thread Sean Fu
Remove unnessesary NULL check before kmem_cache_destroy() in drivers/md/bcache/request.c Signed-off-by: Sean Fu --- drivers/md/bcache/request.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index ae67f5f..0ddee35

Re: [PATCH] md/bcache: Remove NULL check.

2018-08-13 Thread Sean Fu
On Mon, Aug 13, 2018 at 06:00:11PM +0800, Coly Li wrote: > On 2018/8/13 5:38 PM, Sean Fu wrote: > > Remove unnessesary NULL check before kmem_cache_destroy() in > > drivers/md/bcache/request.c > > > > Signed-off-by: Sean Fu > > Hi Sean, > > A same cha

Re: [PATCH] fs/buffer.c: Optimize grow_buffer function.

2018-08-08 Thread Sean Fu
On Sat, Jul 21, 2018 at 07:21:16PM +0100, Al Viro wrote: > On Sun, Jul 22, 2018 at 01:30:17AM +0800, Sean Fu wrote: > > Use PAGE_SHIFT and i_blkbits of bd_inode directly to avoid ugly sizebits > > calculation. > > Remove ugly sizebits calculation. > > Remove unn

[PATCH] xfs: Use kmem_zalloc for bp->b_pages.

2019-03-09 Thread Sean Fu
data bss dec hex filename 23293 588 8 238895d51 ./fs/xfs/xfs_buf.o Signed-off-by: Sean Fu --- fs/xfs/xfs_buf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 4f5f2ff3f70f..be4f740b97c1 100644 --- a/

Re: [PATCH] xfs: Use kmem_zalloc for bp->b_pages.

2019-03-09 Thread Sean Fu
On Sat, Mar 09, 2019 at 09:32:30AM -0800, Darrick J. Wong wrote: > On Sat, Mar 09, 2019 at 11:36:36PM +0800, Sean Fu wrote: > > Change the allocation of bp->b_pages to use kmem_zalloc instead of > > kmem_alloc. > > Remove unnecessary memset for bp->b_pages. > >

Re: [PATCH] fs/buffer.c: Optimize grow_buffer function.

2018-07-24 Thread Sean Fu
On Sat, Jul 21, 2018 at 07:21:16PM +0100, Al Viro wrote: > On Sun, Jul 22, 2018 at 01:30:17AM +0800, Sean Fu wrote: > > Use PAGE_SHIFT and i_blkbits of bd_inode directly to avoid ugly sizebits > > calculation. > > Remove ugly sizebits calculation. > > Remove unn

[PATCH] fs/buffer.c: Optimize grow_buffer function.

2018-07-21 Thread Sean Fu
bss dec hex filename 340371510 16 355638aeb fs/buffer.o After: sean@linux-zmni:~/sda5/source/linus_repo/linux> size fs/buffer.o textdata bss dec hex filename 340211510 16 355478adb fs/buffer.o Signed-off-by: Sean Fu --- fs/buffer.

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-08-26 Thread Sean Fu
On Wed, Aug 26, 2015 at 3:05 AM, Steven Rostedt wrote: > On Tue, 25 Aug 2015 13:33:57 -0400 > Austin S Hemmelgarn wrote: > >> >> How do you know that? >> > I will prove that all other write usage is not impacted later. >> Except that you can only really do this for programs that you have >>

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-08-26 Thread Sean Fu
On Thu, Aug 27, 2015 at 4:36 AM, Steven Rostedt wrote: > On Wed, 26 Aug 2015 23:48:01 +0800 > Sean Fu wrote: > > >> > Defending the patch, I can't imagine any user space code expecting the >> > current behavior. The current behavior is that if you write "

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-08-26 Thread Sean Fu
On Wed, Aug 26, 2015 at 4:39 AM, Heinrich Schuchardt wrote: > > > On 24.08.2015 10:56, Sean Fu wrote: >> when the input argument "count" including the terminating byte "\0", >> The write system call return EINVAL on proc file. >> But it return s

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-08-27 Thread Sean Fu
On Thu, Aug 27, 2015 at 10:32 AM, Steven Rostedt wrote: > On Thu, 27 Aug 2015 08:17:29 +0800 > Sean Fu wrote: > >> On Thu, Aug 27, 2015 at 4:36 AM, Steven Rostedt wrote: >> > On Wed, 26 Aug 2015 23:48:01 +0800 >> > Sean Fu wrote: >> > >> > &g

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-08-27 Thread Sean Fu
On Thu, Aug 27, 2015 at 4:32 PM, Sean Fu wrote: > On Thu, Aug 27, 2015 at 10:32 AM, Steven Rostedt wrote: >> On Thu, 27 Aug 2015 08:17:29 +0800 >> Sean Fu wrote: >> >>> On Thu, Aug 27, 2015 at 4:36 AM, Steven Rostedt wrote: >>> > On Wed, 26 Au

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-09-07 Thread Sean Fu
On Fri, Aug 28, 2015 at 11:31 AM, Sean Fu wrote: > On Thu, Aug 27, 2015 at 4:32 PM, Sean Fu wrote: >> On Thu, Aug 27, 2015 at 10:32 AM, Steven Rostedt wrote: >>> On Thu, 27 Aug 2015 08:17:29 +0800 >>> Sean Fu wrote: >>>> strace execute result: >>&g

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-09-11 Thread Sean Fu
On Wed, Sep 9, 2015 at 12:36 AM, Steven Rostedt wrote: > On Tue, 08 Sep 2015 11:19:14 -0500 > ebied...@xmission.com (Eric W. Biederman) wrote: > > >> This patch does not implement the old behavior. >> >> The old code does use '\0' as a buffer terminator, and because it does >> not check things

[PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-08-24 Thread Sean Fu
when the input argument "count" including the terminating byte "\0", The write system call return EINVAL on proc file. But it return success on regular file. E.g. Writting two bytes ("1\0") to "/proc/sys/net/ipv4/conf/eth0/rp_filter". write(fd, "1\

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-08-24 Thread Sean Fu
On Mon, Aug 24, 2015 at 8:27 PM, Eric W. Biederman wrote: > > > On August 24, 2015 1:56:13 AM PDT, Sean Fu wrote: >>when the input argument "count" including the terminating byte "\0", >>The write system call return EINVAL on proc file. >>But

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-08-24 Thread Sean Fu
d, "0\0", 2); printf("write %d: len=%d, errno=%d, %s\n", fd, len, errno, strerror(errno)); close(fd); return 0; } On Tue, Aug 25, 2015 at 12:59 AM, Steven Rostedt wrote: > On Mon, 24 Aug 2015 16:56:13 +0800 > Sean Fu wrote: > >> when t

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-08-24 Thread Sean Fu
rsion 4.1.2 20070115 (SUSE Linux)) #1 SMP Fri Sep 2 13:49:16 UTC 2011 linux-8lij:~ # gcc ./proc_test.c -o ./proc_test linux-8lij:~ # ./proc_test eth7 Input: ./proc_test, eth7 file is: /proc/sys/net/ipv4/conf/eth7/rp_filter. open /proc/sys/net/ipv4/conf/eth7/rp_filter ok, fd=3 write 3: len=1, errno=0,

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-08-25 Thread Sean Fu
On Tue, Aug 25, 2015 at 10:24 AM, Eric W. Biederman wrote: > > > On August 24, 2015 6:57:57 PM MDT, Sean Fu wrote: >>An application from HuaWei which works fine on 2.6 encounters this >>issue on 3.0 or later kernel. > > My sympathies. Being stuck with a 3rd party appl

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-08-25 Thread Sean Fu
On Tue, Aug 25, 2015 at 10:15 PM, Steven Rostedt wrote: > On Tue, 25 Aug 2015 15:50:18 +0800 > Sean Fu wrote: > >> On Tue, Aug 25, 2015 at 10:24 AM, Eric W. Biederman >> wrote: >> > >> > >> > On August 24, 2015 6:57:57 PM MDT, Sean Fu wrote:

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-08-26 Thread Sean Fu
On Wed, Aug 26, 2015 at 4:39 AM, Heinrich Schuchardt wrote: > > > On 24.08.2015 10:56, Sean Fu wrote: >> when the input argument "count" including the terminating byte "\0", >> The write system call return EINVAL on proc file. >> But it return s

Re: [PATCH] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.

2016-09-08 Thread Sean Fu
On Tue, Sep 06, 2016 at 11:12:20AM -0400, Jeff Mahoney wrote: > On 9/6/16 5:58 AM, David Sterba wrote: > > On Mon, Sep 05, 2016 at 11:13:40PM -0400, Jeff Mahoney wrote: > Since root is only used to get fs_info->chunk_root, why not use fs_info > directly? > >>> > >>> Weird. Exactly this

Re: [PATCH] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.

2016-09-08 Thread Sean Fu
On Thu, Sep 08, 2016 at 11:25:48PM -0400, Jeff Mahoney wrote: > On 9/8/16 11:08 PM, Sean Fu wrote: > > On Tue, Sep 06, 2016 at 11:12:20AM -0400, Jeff Mahoney wrote: > >> On 9/6/16 5:58 AM, David Sterba wrote: > >>> On Mon, Sep 05, 2016 at 11:13:40PM -0400, Jeff Maho

Re: [PATCH] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.

2016-09-10 Thread Sean Fu
On Thu, Sep 08, 2016 at 11:25:48PM -0400, Jeff Mahoney wrote: > On 9/8/16 11:08 PM, Sean Fu wrote: > > On Tue, Sep 06, 2016 at 11:12:20AM -0400, Jeff Mahoney wrote: > >> On 9/6/16 5:58 AM, David Sterba wrote: > >>> On Mon, Sep 05, 2016 at 11:13:40PM -0400, Jeff Maho

Re: [PATCH] fs: buffer: Modify alloc_page_buffers.

2017-06-21 Thread Sean Fu
On Mon, Jun 19, 2017 at 05:03:16PM +0100, Al Viro wrote: > On Mon, Jun 19, 2017 at 09:01:36PM +0800, Sean Fu wrote: > > Make alloc_page_buffers support circular buffer list and initialise > > b_state field. > > Optimize the performance by removing the buffer list traversal t

Re: [PATCH] fs: buffer: Modify alloc_page_buffers.

2017-06-23 Thread Sean Fu
On Mon, Jun 19, 2017 at 05:03:16PM +0100, Al Viro wrote: > On Mon, Jun 19, 2017 at 09:01:36PM +0800, Sean Fu wrote: > > Make alloc_page_buffers support circular buffer list and initialise > > b_state field. > > Optimize the performance by removing the buffer list traversal t

[PATCH] fs: buffer: Modify alloc_page_buffers.

2017-06-19 Thread Sean Fu
Make alloc_page_buffers support circular buffer list and initialise b_state field. Optimize the performance by removing the buffer list traversal to create circular buffer list. Signed-off-by: Sean Fu --- drivers/md/bitmap.c | 2 +- fs/buffer.c | 37

Re: [PATCH] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.

2016-09-06 Thread Sean Fu
On Mon, Sep 05, 2016 at 03:56:41PM +0800, Qu Wenruo wrote: > > > At 09/05/2016 09:19 AM, Zhao Lei wrote: > >Hi, Sean Fu > > > >>From: Sean Fu [mailto:fxinr...@gmail.com] > >>Sent: Sunday, September 04, 2016 7:54 PM > >>To: dste...@suse.com &

Re: [PATCH v2] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.

2016-09-06 Thread Sean Fu
On Tue, Sep 06, 2016 at 01:19:39PM +0800, Zhao Lei wrote: > Hi, Sean Fu > > > -Original Message- > > From: Sean Fu [mailto:fxinr...@gmail.com] > > Sent: Tuesday, September 06, 2016 11:51 AM > > To: dste...@suse.com > > Cc: c...@fb.com; anand.j...@ora

Re: [PATCH] Btrfs: remove unnecessary code of chunk_root assignment in btrfs_read_chunk_tree.

2016-09-06 Thread Sean Fu
On Tue, Sep 06, 2016 at 11:12:20AM -0400, Jeff Mahoney wrote: > On 9/6/16 5:58 AM, David Sterba wrote: > > On Mon, Sep 05, 2016 at 11:13:40PM -0400, Jeff Mahoney wrote: > Since root is only used to get fs_info->chunk_root, why not use fs_info > directly? > >>> > >>> Weird. Exactly this

Fail to build tools/all

2016-04-30 Thread Sean Fu
Hi guys: I encountered a build error when running "make V=1 tools/all". Shall we write a patch to fix it? The following is error log. start == commit 05cf8077e54b20dddb756eaa26f3aeb5c38dd3cf Merge: cf78031 db5dd0d

Re: Fail to build tools/all

2016-05-02 Thread Sean Fu
On Mon, May 02, 2016 at 12:20:08PM +0200, Thomas Renninger wrote: > On Sunday, May 01, 2016 01:11:33 PM Sean Fu wrote: > > Hi guys: > > I encountered a build error when running "make V=1 tools/all". > > Shall we write a patch to

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-09-13 Thread Sean Fu
On Sat, Sep 12, 2015 at 1:01 AM, Eric W. Biederman wrote: > Sean Fu writes: > >>> Sounds like a reasonable compromise. Sean, can you make a patch that >>> only affects the one proc file (comment it well in the code), and have >>> it accept nothing past the '\0'.

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-09-15 Thread Sean Fu
t; On Sun, 13 Sep 2015 20:39:31 +0800 > Sean Fu wrote: > > >> > Accepting a '\0' is not at all reasonable for a text interface. The >> > application that does it is buggy. >> It is hard to comprehend that the current kernel can accept two bytes >> "1 &q

Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success.

2015-09-15 Thread Sean Fu
On Mon, Sep 14, 2015 at 12:44 AM, Eric W. Biederman wrote: > Sean Fu writes: > >> On Sat, Sep 12, 2015 at 1:01 AM, Eric W. Biederman >> wrote: >>> Sean Fu writes: > '\0' is not and has never been valid in a text file. > proc files are a text interface. > E

[tip:x86/urgent] x86/sysfs: Fix off-by-one error in loop termination

2017-09-25 Thread tip-bot for Sean Fu
Commit-ID: 7d7099433d9eaaa5a989a55f1fa354c16a3ad297 Gitweb: http://git.kernel.org/tip/7d7099433d9eaaa5a989a55f1fa354c16a3ad297 Author: Sean Fu <fxinr...@gmail.com> AuthorDate: Mon, 11 Sep 2017 08:33:21 +0800 Committer: Thomas Gleixner <t...@linutronix.de> CommitDate: Mon, 25

[tip:x86/urgent] x86/sysfs: Fix off-by-one error in loop termination

2017-09-25 Thread tip-bot for Sean Fu
Commit-ID: 7d7099433d9eaaa5a989a55f1fa354c16a3ad297 Gitweb: http://git.kernel.org/tip/7d7099433d9eaaa5a989a55f1fa354c16a3ad297 Author: Sean Fu AuthorDate: Mon, 11 Sep 2017 08:33:21 +0800 Committer: Thomas Gleixner CommitDate: Mon, 25 Sep 2017 09:36:16 +0200 x86/sysfs: Fix off-by-one

  1   2   >