[TRIVIAL][PATCH] x86/ioapic: Using printk in func print_entries avoiding print incomplete infos

2014-02-23 Thread majianpeng
Commit(afcc8a40a090f): Introduce x86_io_apic_ops.print_entries for debugging. Using kernel parameter apci=debug/verbose, kernel print the incomplete infomation if we don't enable CONFIG_DYNAMIC_DEBUG. So using printk to replace. Signed-off-by: Jianpeng Ma --- arch/x86/kernel/apic/io_apic.c |

[BUG] Plug vga cable induce usb irq disabled.

2014-02-21 Thread majianpeng
Hi all: I met a problem. When i plug vga cable(only need once), the kernel print those messages and disable IRQ 16. [ 16.907826] irq 16: nobody cared (try booting with the "irqpoll" option) [ 16.907834] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.14.0-rc3+ #74 [ 16.907836] Hardware

[PATCH 1/3] block: Add REQ_NOMERGE into REQ_COMMON_MASK

2013-10-29 Thread majianpeng
For bio with REQ_NOMERGE,it mean this bio can't merge with other bios. And the request with this bio has the same meaning. In blk_queue_bio, bio with REQ_NOMERGE can't be merged and get a new request. But in init_request_from_bio, request can't test REQ_NOMERGE. So the request can merge other bio o

[PATCH 2/3] block: Check bio can merge before call attempt_plug_merge.

2013-10-29 Thread majianpeng
Signed-off-by: Jianpeng Ma --- block/blk-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-core.c b/block/blk-core.c index 0a00e4e..fb970fd 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1492,7 +1492,7 @@ void blk_queue_bio(struct request_queue *q, str

[PATCH 0/3] handle some bugs for REQ_NOMERGE.

2013-10-29 Thread majianpeng
This patch set mainly handle some bugs for REQ_NOMERGE. Jianpeng Ma (3): block: Add REQ_NOMERGE into REQ_COMMON_MASK block: Check bio can merge before call attempt_plug_merge. md/raid5: For stripe with R5_ReadNoMerge, we replace REQ_FLUSH with REQ_NOMERGE. block/blk-core.c

[PATCH 3/3] md/raid5: For stripe with R5_ReadNoMerge, we replace REQ_FLUSH with REQ_NOMERGE.

2013-10-29 Thread majianpeng
For R5_ReadNoMerge,it mean this bio can't merge with other bios or request.It used REQ_FLUSH to achieve this. But REQ_NOMERGE can do the same work. Signed-off-by: Jianpeng Ma --- drivers/md/raid5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid5.c b/drivers/m

[PATCH] inode: For readonly filesystem, func file_update_time should return -EROFS rather than zero.

2013-10-14 Thread majianpeng
For ext2 mounted with errors=remount-ro, if write a file and because the harddisk error, the fs became ro.But the following test can't return. int main() { int ret; int i = 0; char buff[SIZE]; int fd = open("/opt/test", O_WRONLY|O_TRUNC|O_CREAT); if (fd < 0

Re: Re: [PATCH V2 0/2] Auto stop async-write on block device when device removed.

2013-09-29 Thread majianpeng
>majianpeng writes: > >>>majianpeng writes: >>> >>>> For async-write on block device,if device removed,but the vfs don't know >>>> it. >>>> It will continue to do. >>>> Patch1 set size of inode of block device to zer

[PATCH] block: Don't reread partitions of disk which already mouted.

2013-09-29 Thread majianpeng
If reread partitions of disk, the paths are: blkdev_ioctl->blkdev_reread_part->rescan_partitions->drop_partitions ->invalidate_partition->__invalidate_device In func __invalidate_device, if disk already mounted, it will do shrink_dcache_sb and invalidate_inodes. This operation will effect the fs. S

Re: linux-next: build failure after merge of the ceph tree

2013-09-25 Thread majianpeng
Sorry for that, i notice the commit 73a7075e3f6e.But i misread it. I'll modify this as soon as possible. Thanks! Jianpeng Ma >Hi Sage, > >After merging the ceph tree, today's linux-next build (x86_64 >allmodconfig) failed like this: > >In file included from include/linux/kernel.h:14:0, >

Re: Re: [PATCH V2 0/2] Auto stop async-write on block device when device removed.

2013-09-24 Thread majianpeng
>majianpeng writes: > >>>majianpeng writes: >>> >>>> For async-write on block device,if device removed,but the vfs don't know >>>> it. >>>> It will continue to do. >>>> Patch1 set size of inode of block device to zer

Re: Re: [PATCH V2 0/2] Auto stop async-write on block device when device removed.

2013-09-23 Thread majianpeng
>majianpeng writes: > >> For async-write on block device,if device removed,but the vfs don't know it. >> It will continue to do. >> Patch1 set size of inode of block device to zero when removed disk.By >> this,vfs know >> disk changed. >> Path2

Re: [BUG] On x86_32 system, handle block-device which size is larger than 16TB.

2013-09-16 Thread majianpeng
Hi all, This patch has a long long time.How about this patch? Thanks! Jianpeng Ma >Hi all, >Some time ago, I mentioned there are some problems on x86-32 system about > handling md-block-device which size is larger than 16TB. >And i send a patch.But there are no concern with it. >The w

[PATCH V2 2/2] block_dev: Add size check before doing async write on block device.

2013-09-16 Thread majianpeng
For async-write on block device,when disk removed,the vfs don't know. It will continue do async-write.Add this check it will stop async-write when disk removed. Signed-off-by: Jianpeng Ma --- fs/block_dev.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/block_dev.c b/fs/block_dev.c i

[PATCH V2 1/2] block: Set inode of block_device size to zero when delete gendisk.

2013-09-16 Thread majianpeng
When remove gendisk, set the size of inode of block_device to zero. This is mainly let the vfs know disk removed. Signed-off-by: Jianpeng Ma --- block/genhd.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/block/genhd.c b/block/genhd.c index dadf42b..9a4c245 100644 --- a/block/genhd.c

[PATCH V2 0/2] Auto stop async-write on block device when device removed.

2013-09-16 Thread majianpeng
For async-write on block device,if device removed,but the vfs don't know it. It will continue to do. Patch1 set size of inode of block device to zero when removed disk.By this,vfs know disk changed. Path2 add size-check on blk_aio_write.If pos of write larger than size of inode,it will return ze

[PATCH 2/2] block_dev: Add size check before doing async write on block device.

2013-09-11 Thread majianpeng
For async-write on block device,when disk removed,the vfs don't know. It will continue do async-write.Add this check it will stop async-write when disk removed. Signed-off-by: Jianpeng Ma --- fs/block_dev.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/block_dev.c b/fs/block_dev.c i

[PATCH 0/2] Auto stop async-write on block device when device removed.

2013-09-11 Thread majianpeng
For async-write on block device,if device removed,but the vfs don't know it. It will continu do. Patch1 set size of inode of block device to zero when removed disk.By this,vfs know disk changed. Path2 add size-check on blk_aio_write.If pos of write larger than size of inode,it will return zero.S

[PATCH 1/2] block: Set inode of block_device size to zero when delete gendisk.

2013-09-11 Thread majianpeng
When remove gendisk, set the size of inode of block_device to zero. This is mainly let the vfs know disk removed. Signed-off-by: Jianpeng Ma --- block/genhd.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/block/genhd.c b/block/genhd.c index dadf42b..c3a54b4 100644 --- a/blo

Re: [PATCH] block: trace all devices plug operation.

2013-09-01 Thread majianpeng
Hi axboe: How about this patch? Thanks! Jianpeng Ma >In func blk_queue_bio, if list of plug is empty,it will call >blk_trace_plug. >If process deal with a single device,it't ok.But if process deal with >multi devices,it only trace the first device. >Using request_count to judge, it can sol

[Question]: about the paramters of func generic_file_buffered_write.

2013-08-30 Thread majianpeng
Hi all, The definition of func generic_file_buffered_write is: ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, unsigned long, loff_t, loff_t *, size_t, ssize_t); The fourth an

[PATCH] block: trace all devices plug operation.

2013-08-20 Thread majianpeng
In func blk_queue_bio, if list of plug is empty,it will call blk_trace_plug. If process deal with a single device,it't ok.But if process deal with multi devices,it only trace the first device. Using request_count to judge, it can soleve this problem. In addition, i modify the comment. Signed-off-

Re: Re: [PATCH] mmc: omap_hsmmc: Fix sleep too long in ISR context.

2013-08-01 Thread majianpeng
>Hi Jianpeng Ma, > >On 8/1/2013 10:18 AM, majianpeng wrote: >> We found a problem when we removed a working sd card that the irqaction >> of omap_hsmmc can sleep to 3.6s. This cause our watchdog to work. >> In func omap_hsmmc_reset_controller_fsm, it should watch a

[PATCH] mmc: omap_hsmmc: Fix sleep too long in ISR context.

2013-07-31 Thread majianpeng
We found a problem when we removed a working sd card that the irqaction of omap_hsmmc can sleep to 3.6s. This cause our watchdog to work. In func omap_hsmmc_reset_controller_fsm, it should watch a 0->1 transition.It used loops_per_jiffy as the timer. The code is: > while ((!(OMAP_HSMMC_READ(host->b

Re: Re: question about splice

2013-07-26 Thread majianpeng
>Hi Jianpeng, > >On 07/26/2013 03:08 PM, majianpeng wrote: > >> Hi all, >> I used splice and found a prolem(at least i call). >> The demo is: >> A:splice(regularfileA--->pipe); >> B:splice(pipe--->regularfileB) >> Before do B, we

question about splice

2013-07-26 Thread majianpeng
Hi all, I used splice and found a prolem(at least i call). The demo is: A:splice(regularfileA--->pipe); B:splice(pipe--->regularfileB) Before do B, we modify the data of regA which now in pipe. The data to regularfileB willbe change. If we used the buff A:read(regA, buff); B: write(buff, r

Re: Re: [PATCH] ceph: Don't use ceph-sync-mode for synchronous-fs.

2013-07-23 Thread majianpeng
>? > >Thanks! >sage > > >On Wed, 24 Jul 2013, majianpeng wrote: > >> Ping >> >Hi sage, >> >How about this patch?Can you give some advisement? >> >Thanks! >> >Jianpeng Ma >> >>At now for synchronous-fs, all write-operati

About omap2 mmc host close too long irq in irqaction.

2013-07-17 Thread majianpeng
Hi all, Now i worked on omp2 and met a probelm which someplace close_irq for 3.6second. The kernel version is 2.6.37. I used trace to find in irq_action:omap_hsmmc_irq. This problem occured by removed the sdcard when there are io operations. I found the read problem is in omap_hsmmc_rese

[PATCH] time: silence warning in tick_nohz_init().

2013-07-16 Thread majianpeng
Fix those warning message when compile: >kernel/time/tick-sched.c: In function ‘tick_nohz_init’: >kernel/time/tick-sched.c:346:6: warning: unused variable ‘cpu’ >[-Wunused-variable] Signed-off-by: Jianpeng Ma --- kernel/time/tick-sched.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kern

[PATCH] libceph: Unregister request if __map_request failed.

2013-07-12 Thread majianpeng
In func ceph_osdc_start_request, if __mape_request failed, it should call __unregister_request avoid cause bugs, etc memleak, umount fs failed. Signed-off-by: Jianpeng Ma --- net/ceph/osd_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c i

compile x86_64 waring

2013-07-05 Thread majianpeng
Hi all, Compile x86_64 meet those messages: WARNING: arch/x86/mm/built-in.o(.text.unlikely+0xbf8): Section mismatch in reference from the function __node_set.constprop.0() to the variable .init.data:numa_nodes_parsed The function __node_set.constprop.0() references the variable __initdata

[PATCH 2/2] ceph: for sync_read, call file_accessed to update atime.

2013-07-02 Thread majianpeng
For ceph_sync_read,it don't call file_accessed to update atime.But the buffer_read do it .So add it. Signed-off-by: Jianpeng Ma --- fs/ceph/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index fa74e6f..b0e6f0b 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/

[PATCH 1/2] ceph: update atime after read.

2013-07-02 Thread majianpeng
Now ceph don't update atime after read.So add this function. Signed-off-by: Jianpeng Ma --- fs/ceph/file.c | 9 + 1 file changed, 9 insertions(+) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 656e169..fa74e6f 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -669,6 +669,15 @@ aga

Re: Re: [PATCH 1/3] mds: update atime if client can read.

2013-07-02 Thread majianpeng
>On Tue, 2 Jul 2013, majianpeng wrote: >> Now, update atime only for CEPH_CAP_FILE_EXCL.Change this if >> CEPH_CAP_FILE_RD. > >Can we introduce a global config optoin (bool mds_atime in >common/config_opts.h, maybe) so that users can turn this off? And/or add >a &#x

[RFC PATCH] ceph: send the ctime of file/snap when send a cap msg.

2013-07-02 Thread majianpeng
Now,when sent a cap msg to inode/snap, it don't include the ctime of inode/snap.So make the mtime ahead of ctime. BTY,for snap, i'm not exactly send the ctime of snap or null. Signed-off-by: Jianpeng Ma --- fs/ceph/caps.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff -

[PATCH 1/3] mds: update atime if client can read.

2013-07-01 Thread majianpeng
Now, update atime only for CEPH_CAP_FILE_EXCL.Change this if CEPH_CAP_FILE_RD. Signed-off-by: Jianpeng Ma --- src/mds/Locker.cc | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 30e014a..58f953f 100644 --- a/src/mds/Lo

[PATCH 2/3] ceph: update atime after read-operation.

2013-07-01 Thread majianpeng
Now ceph don't support updating atime after read-operation if the open mode is CEPH_CAP_FILE_RD.There are two reasons: 1:in client of fs,it don't set dirty cap of CEPH_CAP_FILE_RD. 2:in mds,it only update the atime if the condition "dirty & (CEPH_CAP_FILE_EXCL|CEPH_CAP_FILE_WR) is true. But if we c

[PATCH 3/3] ceph: For ceph_sync_read, update the atime of file.

2013-07-01 Thread majianpeng
For buffer read, the func generic_file_aio_read will update atime of file.But the ceph_sync_read don't do it.So add this. Signed-off-by: Jianpeng Ma --- fs/ceph/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 656e169..87df15a 100644 --- a/fs/ce

[PATCH 0/3] implement of updating atime for client has CEPH_CAP_FILE_RD

2013-07-01 Thread majianpeng
Now update atime of file, only for client had CEPH_CAP_FLE_EXCL.But for atime, if one can read he can update this attribte. For this feature,it need both client and mds modify. PATCH1,it modify the mds to support. PATCH2,it modify the client to suport. PATCH3, it support this feature for sync_read

[PATCH V1] elevator: Fix a race about elevator switching.

2013-07-01 Thread majianpeng
Thare's a race between elevator switching and normal io operation. Because the allocation of struct elevator_queue and struct elevator_data don't in a atomic operation.So there are have chance to use NULL ->elevator_data. For example: Thread A:

[PATCH] ceph: Don't use ceph-sync-mode for synchronous-fs.

2013-06-27 Thread majianpeng
At now for synchronous-fs, all write-operations use ceph_sync_mode. But for the file which opened with O_SYNC, it don't use sync_mode. The behaviour of them should be the same. For fs which mounted using '-o sync', it want all I/O to the filesystem should be done synchronously.But the ceph-sync-mod

[PATCH] ceph: Reconstruct the func ceph_reserve_caps.

2013-06-25 Thread majianpeng
Signed-off-by: Jianpeng Ma --- fs/ceph/caps.c | 21 +++-- fs/ceph/super.h | 2 +- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index da0f9b8..6d2655c 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -147,7 +147,7 @@ void ceph

[PATCH] libceph: Call con->ops->put(con) if cancel_delayed_work(&con->work) worked.

2013-06-23 Thread majianpeng
Because in func queue_con_delay, it will call con->ops->get(con). So if we cancel the work successfully,we must call con->ops->put(con). Otherwise some resource can't free like 'struct ceph_mds_session'. Signed-off-by: Jianpeng Ma --- net/ceph/messenger.c | 3 ++- 1 file changed, 2 insertions(+)

[PATCH] ceph: avoid meaningless calling ceph_caps_revoking if sync_mode == WB_SYNC_ALL.

2013-06-19 Thread majianpeng
Signed-off-by: Jianpeng Ma --- fs/ceph/addr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 3e68ac1..25fa8b8 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -677,8 +677,8 @@ static int ceph_writepages_start(struct address_space

[PATCH V1] ceph: fix sleeping function called from invalid context.

2013-06-18 Thread majianpeng
[ 1121.231883] BUG: sleeping function called from invalid context at kernel/rwsem.c:20 [ 1121.231935] in_atomic(): 1, irqs_disabled(): 0, pid: 9831, name: mv [ 1121.231971] 1 lock held by mv/9831: [ 1121.231973] #0: (&(&ci->i_ceph_lock)->rlock){+.+...},at:[] ceph_getxattr+0x58/0x1d0 [ceph] [ 1

Re: Re: [PATCH] ceph: fix sleeping function called from invalid context.

2013-06-18 Thread majianpeng
>On Tue, 18 Jun 2013, majianpeng wrote: >> [ 1121.231883] BUG: sleeping function called from invalid context at >> kernel/rwsem.c:20 >> [ 1121.231935] in_atomic(): 1, irqs_disabled(): 0, pid: 9831, name: mv >> [ 1121.231971] 1 lock held by mv/9831: >> [ 1121.

[PATCH] ceph: fix sleeping function called from invalid context.

2013-06-18 Thread majianpeng
[ 1121.231883] BUG: sleeping function called from invalid context at kernel/rwsem.c:20 [ 1121.231935] in_atomic(): 1, irqs_disabled(): 0, pid: 9831, name: mv [ 1121.231971] 1 lock held by mv/9831: [ 1121.231973] #0: (&(&ci->i_ceph_lock)->rlock){+.+...}, at:[] ceph_getxattr+0x58/0x1d0 [ceph] [ 1

[PATCH] ceph: remove sb_start/end_write in ceph_aio_write.

2013-06-17 Thread majianpeng
Either in vfs_write or io_submit,it call file_start/end_write. The different between file_start/end_write and sb_start/end_write is file_ only handle regular file.But i think in ceph_aio_write,it only for regular file. Signed-off-by: Jianpeng Ma --- fs/ceph/file.c | 2 -- 1 file changed, 2 delet

[PATCH] drm/nouveau: fix a memory leak.

2013-06-15 Thread majianpeng
When cleanup extra stat if this object was a notifier,it should free the notifier. Signed-off-by: Jianpeng Ma --- drivers/gpu/drm/nouveau/nouveau_abi16.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouv

[BUG] Using inotify on /proc/partitoins

2013-06-13 Thread majianpeng
Hi all, I wanted to monitor /proc/partitions using inotify.Although now i know it can't catch the event of write. But for read,it can't catch. The code is: int main() { int fd = inotify_init(); int wd; char buff[4096]; int ret; if (fd < 0)

Re: Re: [PATCH 2/3] mm/kmemleak.c: Use list_for_each_entry_safe to reconstruct function scan_gray_list

2013-06-02 Thread majianpeng
>On Tue, May 14, 2013 at 12:49:44PM +0100, majianpeng wrote: >> Signed-off-by: Jianpeng Ma >> --- >> mm/kmemleak.c | 8 +--- >> 1 file changed, 1 insertion(+), 7 deletions(-) >> >> diff --git a/mm/kmemleak.c b/mm/kmemleak.c >> index b1525db..f0ec

Re: [RFC][PATCH] f2fs: Avoid print false deadlock messages.

2013-05-16 Thread majianpeng
On 05/16/2013 04:41 PM, Peter Zijlstra wrote: > On Thu, May 16, 2013 at 09:16:45AM +0800, majianpeng wrote: > >>> There isn't. What you typically want to do is annotate the lock site. >>> In particular it looks like mutex_lock_all() is the offensive piece of >>&g

Re: [RFC][PATCH] f2fs: Avoid print false deadlock messages.

2013-05-15 Thread majianpeng
On 05/15/2013 04:28 PM, Peter Zijlstra wrote: > On Wed, May 15, 2013 at 02:58:53PM +0800, majianpeng wrote: >> When mounted the f2fs, kernel will print the following messages: >> >> [ 105.533038] = >> [ 105.533065] [ INFO:

Re: [RFC][PATCH] f2fs: Avoid print false deadlock messages.

2013-05-15 Thread majianpeng
On 05/15/2013 03:21 PM, Libo Chen wrote: > On 2013/5/15 14:58, majianpeng wrote: >> By adding some messages, i found this problem because the gcc >> optimizing. For those codes: >>>>for (i = 0; i < NR_GLOBAL_LOCKS; i++) >>>>mutex_in

[RFC][PATCH] f2fs: Avoid print false deadlock messages.

2013-05-15 Thread majianpeng
When mounted the f2fs, kernel will print the following messages: [ 105.533038] = [ 105.533065] [ INFO: possible recursive locking detected ] [ 105.533088] 3.10.0-rc1+ #101 Not tainted [ 105.533105] - [ 105

[PATCH 3/3] mm/kmemleak.c: Merge the consecutive scan-areas.

2013-05-14 Thread majianpeng
If the scan-areas are adjacent,it can merge in order to reduce memomy. And using pr_warn instead of pr_warning. Signed-off-by: Jianpeng Ma --- mm/kmemleak.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index f0ece93

[PATCH 2/3] mm/kmemleak.c: Use list_for_each_entry_safe to reconstruct function scan_gray_list

2013-05-14 Thread majianpeng
Signed-off-by: Jianpeng Ma --- mm/kmemleak.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index b1525db..f0ece93 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1225,22 +1225,16 @@ static void scan_gray_list(void) * from inside

[PATCH 0/3] mm/kmemleak.c: Fix some trivial problems.

2013-05-14 Thread majianpeng
Jianpeng Ma (3): mm/kmemleak.c: Use %u to print ->checksum. mm/kmemleak.c: Use list_for_each_entry_safe to reconstruct function scan_gray_list. mm/kmemleak.c: Merge the consecutive scan-areas. mm/kmemleak.c | 36 +--- 1 file changed, 21 insertions(+),

[PATCH 1/3] mm/kmemleak.c: Use %u to print ->checksum.

2013-05-14 Thread majianpeng
Signed-off-by: Jianpeng Ma --- mm/kmemleak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index c8d7f31..b1525db 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -386,7 +386,7 @@ static void dump_object_info(struct kmemleak_object *object)

[PATCH] module: Add section ".ref.data" into kmemleak-scan-area.

2013-05-10 Thread majianpeng
In commit 523c81135,it used "__refdata" on event_class_ftrace_##call. It will cause kmemleak to misjudge because when loading module it did not add '.ref.data' into kmemleak-scan-area. Signed-off-by: Jianpeng Ma --- kernel/module.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[BUG] On x86_32 system, handle block-device which size is larger than 16TB.

2013-04-25 Thread majianpeng
Hi all, Some time ago, I mentioned there are some problems on x86-32 system about handling md-block-device which size is larger than 16TB. And i send a patch.But there are no concern with it. The website of is: http://www.spinics.net/lists/linux-fsdevel/msg55672.html. Except the wrapping pr

[PATCH V1] fs/buffer.c: Remove unnecessary init operation after, allocating buffer_head.

2013-04-21 Thread majianpeng
Because alloc 'struct buffer_head' using kmem_cache_zalloc,so it doesn't need to call 'init_buffer(bh, NULL, NULL)' and other set-zero-operation. Signed-off-by: Jianpeng Ma --- fs/buffer.c | 2 -- fs/jbd/journal.c | 2 -- fs/jbd2/journal.c | 2 -- 3 files changed, 6 deletions(-) diff --g

Re: [PATCH] fs/buffer.c: Remove the unnecessary init operation after allocating buffer_head.

2013-04-21 Thread majianpeng
On 04/19/2013 10:48 PM, Jan Kara wrote: > On Fri 19-04-13 10:29:36, majianpeng wrote: >> Because alloc struct buffer_head using kmem_cache_zalloc,so it's not need to >> call 'init_buffer(bh, NULL, NULL)'. >> >> Signed-off-by: Jianpeng Ma >> --- &

[PATCH] fs/buffer.c: Remove the unnecessary init operation after allocating buffer_head.

2013-04-18 Thread majianpeng
Because alloc struct buffer_head using kmem_cache_zalloc,so it's not need to call 'init_buffer(bh, NULL, NULL)'. Signed-off-by: Jianpeng Ma --- fs/buffer.c | 2 -- fs/jbd/journal.c | 1 - fs/jbd2/journal.c | 1 - 3 files changed, 4 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c inde

Re: elevator: Fix a race about elevator switching.

2013-04-15 Thread majianpeng
Hi Jens, How about this patch? It was a long time. Thanks! Jianpeng Ma > Thare's a race between elevator switching and normal io operation. > Because the allocation of struct elevator_queue and struct elevator_data > don't in a atomic operation.So there are have chance to use NULL > ->

[RFC PATCH]fs/block_dev.c: Using .ki_left to judge whether do used .ki_left to judge

2013-04-13 Thread majianpeng
Signed-off-by: Jianpeng Ma --- fs/block_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index aae187a..f0328f1 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1559,7 +1559,7 @@ static ssize_t blkdev_aio_read(struct kiocb *iocb, const

[PATCH] vfs: Remove the unnecessary protect.

2013-04-09 Thread majianpeng
After allocating a inode,it don't chain in superblock.At this time,it won't be used by others.So it make no sense to protect there. Signed-off-by: Jianpeng Ma --- fs/inode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index f5f7c06..1d7b0dd 100644 --- a/fs/inode.c

[PATCH] fuse: Don't do file_update_time for write_operation.

2013-03-28 Thread majianpeng
For direct-write and normal-write operations, after write they will call fuse_invalidate_attr. So it's make no sense to call file_update_time before writing. In function file_update_time, there is other thing which update version of inode.For this i am not sure. Signed-off-by: Jianpeng Ma --- f

[PATCH] fuse: Consider the ->big_writes for allocing fuse_req when do writing

2013-03-26 Thread majianpeng
If fc->big_writes == 0, for write-operation it only do 4k in func fuse_fill_write_pages. So when alloc fuse_req,we should consider this restrict in order to do additional operations. The additional operations are memset-opeartion in func fuse_requenst_alloc and alloc more space if nr_pages is lar

elevator: Fix a race about elevator switching.

2013-02-21 Thread majianpeng
Thare's a race between elevator switching and normal io operation. Because the allocation of struct elevator_queue and struct elevator_data don't in a atomic operation.So there are have chance to use NULL ->elevator_data. For example: Thread A:

Re: Re: For the condition "file->f_mode", when it failed, it should return EACCES rather than EBADF.

2013-02-05 Thread majianpeng
>On Sun, Feb 03 2013, majianpeng wrote: >> Hi all, >> When I wanted to do discard operations,but i set the openflag was >> O_RDONLY,it returned a EBADF rather than EACCES or EPERM. >> I searched the code and found: >> >case BLKDISCARD: >> >c

For the condition "file->f_mode", when it failed, it should return EACCES rather than EBADF.

2013-02-03 Thread majianpeng
Hi all, When I wanted to do discard operations,but i set the openflag was O_RDONLY,it returned a EBADF rather than EACCES or EPERM. I searched the code and found: >case BLKDISCARD: >case BLKSECDISCARD: { > uint64_t range[2]; > if (!(mode & FMODE_WRITE)) >

Re: Re: [PATCH] blkcg: Before starting a new slice, firstly count bps/iops limit in func tg_may_dispatch.

2013-01-14 Thread majianpeng
>On Mon, Jan 14, 2013 at 10:15:58AM +0800, majianpeng wrote: > >[..] >> >Index: linux-2.6/block/blk-throttle.c >> >=== >> >--- linux-2.6.orig/block/blk-throttle.c 2012-10-18 01:52:28.

Re: Re: [PATCH] blkcg: Before starting a new slice, firstly count bps/iops limit in func tg_may_dispatch.

2013-01-13 Thread majianpeng
[maybe you received more, I'm very sorry for that] >On Fri, Jan 11, 2013 at 03:26:37PM +0100, Jens Axboe wrote: >> On 2013-01-11 10:11, majianpeng wrote: >> > In func tg_may_dispatch, >> >> if (throtl_slice_used(td, tg, rw)) >> >> throtl

Re: Re: [PATCH] blkcg: Before starting a new slice, firstly count bps/iops limit in func tg_may_dispatch.

2013-01-13 Thread majianpeng
>On Fri, Jan 11, 2013 at 03:26:37PM +0100, Jens Axboe wrote: >> On 2013-01-11 10:11, majianpeng wrote: >> > In func tg_may_dispatch, >> >> if (throtl_slice_used(td, tg, rw)) >> >> throtl_start_new_slice(td, tg, rw); >> > ... &g

Re: Re: [PATCH] blkcg: Before starting a new slice, firstly count bps/iops limit in func tg_may_dispatch.

2013-01-13 Thread majianpeng
>On Fri, Jan 11, 2013 at 03:26:37PM +0100, Jens Axboe wrote: >> On 2013-01-11 10:11, majianpeng wrote: >> > In func tg_may_dispatch, >> >> if (throtl_slice_used(td, tg, rw)) >> >> throtl_start_new_slice(td, tg, rw); >> > ... &g

[PATCH] blkcg: Before starting a new slice, firstly count bps/iops limit in func tg_may_dispatch.

2013-01-11 Thread majianpeng
In func tg_may_dispatch, >if (throtl_slice_used(td, tg, rw)) > throtl_start_new_slice(td, tg, rw); ... >if (tg_with_in_bps_limit(td, tg, bio, &bps_wait) > && tg_with_in_iops_limit(td, tg, bio, &iops_wait)) { In funcs tg_with_in_(bps/iops)_limit, it used the slice_start to c

[PATCH] block: Remove judgement for rq_mergeable(rq) in func elv_rqhash_find.

2013-01-06 Thread majianpeng
Because only mergeable rq can add rqhash.So it does not make sense to judge rq_mergeable(rq) in func elv_rqhash_find. Signed-off-by: Jianpeng Ma --- block/elevator.c |5 - 1 file changed, 5 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index 9edba1b..d5901a4 100644 --- a

[PATCH] block: Remove judgement for rq_mergeable(rq) in func elv_rqhash_find.

2013-01-06 Thread majianpeng
Because only mergeable rq can add rqhash.So it does not make sense to judge rq_mergeable(rq) in func elv_rqhash_find. Signed-off-by: Jianpeng Ma --- block/elevator.c |5 - 1 file changed, 5 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index 9edba1b..d5901a4 100644 --- a

[PATCH] block: Remove should_sort judgement when flush blk_plug.

2012-12-25 Thread majianpeng
In commit 975927b942c932,it add blk_rq_pos to sort rq when flushing. Although this commit was used for the situation which blk_plug handled multi devices on the same time like md device. I think there must be some situations like this but only single device. So remove the should_sort judgement. Bec

[PATCH] block: Don't use static to define "void *p" in show_partition_start().

2012-08-02 Thread majianpeng
I met a odd prblem:read /proc/partitions may return zero. I wrote a file test.c: int main() { char buff[4096]; int ret; int fd; printf("pid=%d\n",getpid()); while (1) { fd = open("/proc/partitions", O_RDONLY); if (fd < 0) {

Re: Re: [RFC PATCH] fs/direct-io.c: Set bi_rw when alloc bio.

2012-07-29 Thread majianpeng
On 2012-07-27 22:21 Jeff Moyer Wrote: >majianpeng writes: > >> When exec bio_alloc, the bi_rw is zero.But after calling bio_add_page, >> it will use bi_rw. >> Fox example, in functiion __bio_add_page,it will call merge_bvec_fn(). >> The merge_bvec_fn of raid456 w

[RFC PATCH] fs/direct-io.c: Set bi_rw when alloc bio.

2012-07-27 Thread majianpeng
When exec bio_alloc, the bi_rw is zero.But after calling bio_add_page, it will use bi_rw. Fox example, in functiion __bio_add_page,it will call merge_bvec_fn(). The merge_bvec_fn of raid456 will use the bi_rw to judge the merge. >> if ((bvm->bi_rw & 1) == WRITE) >> return biovec->bv_le