[PATCH v4] nvmet,rxe: defer ip datagram sending to tasklet

2018-05-08 Thread Alexandru Moise
47263] lock(&(&nvmeq->q_lock)->rlock); [ 47.648492] [ 47.648492] *** DEADLOCK *** Using NVMEoF after this patch seems to finally be stable, without it, rxe eventually deadlocks the whole system and causes RCU stalls. Signed-off-by: Alexandru Moise <00moses.alexande.

Re: [PATCH v3] nvmet,rxe: defer ip datagram sending to tasklet

2018-05-08 Thread Alexandru Moise
On Tue, May 08, 2018 at 11:09:18AM +0800, Yanjun Zhu wrote: > > > On 2018/5/8 4:58, Alexandru Moise wrote: > > This addresses 3 separate problems: > > > > 1. When using NVME over Fabrics we may end up sending IP > > packets in interrupt context, we should

[PATCH v3] nvmet,rxe: defer ip datagram sending to tasklet

2018-05-07 Thread Alexandru Moise
;nvmeq->q_lock)->rlock); [ 47.648492] [ 47.648492] *** DEADLOCK *** Using NVMEoF after this patch seems to finally be stable, without it, rxe eventually deadlocks the whole system and causes RCU stalls. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- v2->v3:

[PATCH v2] nvmet,rxe: defer ip datagram sending to tasklet

2018-05-07 Thread Alexandru Moise
/0xd0 [ 51.006182] common_interrupt+0xf/0xf [ 51.007129] Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- v1->v2: added Zhu Yanjun's suggestion on in_irq() check drivers/infiniband/sw/rxe/rxe_verbs.c | 13 +++-- 1 file changed, 11 insertions(+), 2 dele

[PATCH] nvmet,rxe: defer ip datagram sending to tasklet

2018-05-06 Thread Alexandru Moise
/0xd0 [ 51.006182] common_interrupt+0xf/0xf [ 51.007129] Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- drivers/infiniband/sw/rxe/rxe_verbs.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/d

Re: [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release

2018-04-11 Thread Alexandru Moise
On Wed, Apr 11, 2018 at 09:28:30PM +, Bart Van Assche wrote: > On Wed, 2018-04-11 at 23:23 +0200, Alexandru Moise wrote: > > Hi, I tested it, it doesn't solve the problem. > > By the time you get here it's already too late, my patch > > prevents this from failing

Re: [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release

2018-04-11 Thread Alexandru Moise
On Wed, Apr 11, 2018 at 01:55:25PM -0600, Bart Van Assche wrote: > On 04/11/18 13:00, Alexandru Moise wrote: > > But the root cause of it is in blkcg_init_queue() when blkg_create() returns > > an ERR ptr, because it tries to insert into a populated index into > > blkcg->

Re: [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release

2018-04-11 Thread Alexandru Moise
On Wed, Apr 11, 2018 at 03:54:53PM +, Bart Van Assche wrote: > On Wed, 2018-04-11 at 16:28 +0200, Alexandru Moise wrote: > > [0.76] BUG: unable to handle kernel NULL pointer dereference at > > 01b4 > > [0.763350] Kernel panic - not syncing: A

Re: [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release

2018-04-11 Thread Alexandru Moise
On Wed, Apr 11, 2018 at 07:20:19AM -0700, Tejun Heo wrote: > Hello, > > On Wed, Apr 11, 2018 at 12:12:56PM +0200, Alexandru Moise wrote: > > > But we already do this through calling blkcg_exit_queue() from > > > __blk_release_queue(). What's missing? > > &

Re: [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release

2018-04-11 Thread Alexandru Moise
On Mon, Apr 09, 2018 at 03:09:38PM -0700, Tejun Heo wrote: > (cc'ing Joseph as he worked on the area recently, hi!) > > Hello, > > On Sat, Apr 07, 2018 at 12:21:48PM +0200, Alexandru Moise wrote: > > The q->id is used as an index within the blkg_tree radix tree.

[PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release

2018-04-07 Thread Alexandru Moise
existing. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- v2: Added no-op for !CONFIG_BLK_CGROUP block/blk-cgroup.c | 2 +- block/blk-sysfs.c | 4 include/linux/blk-cgroup.h | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/block/

[PATCH] blk-cgroup: remove entries in blkg_tree before queue release

2018-04-06 Thread Alexandru Moise
existing. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- block/blk-cgroup.c | 2 +- block/blk-sysfs.c | 4 include/linux/blk-cgroup.h | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c inde

Re: [PATCH] mm,hugetlb,migration: don't migrate kernelcore hugepages

2017-10-02 Thread Alexandru Moise
On Mon, Oct 02, 2017 at 06:15:00PM +0200, Michal Hocko wrote: > On Mon 02-10-17 17:06:38, Alexandru Moise wrote: > > On Mon, Oct 02, 2017 at 04:27:17PM +0200, Michal Hocko wrote: > > > On Mon 02-10-17 16:06:33, Alexandru Moise wrote: > > > > On Mon, Oct 02, 2017 at

Re: [PATCH] mm,hugetlb,migration: don't migrate kernelcore hugepages

2017-10-02 Thread Alexandru Moise
On Mon, Oct 02, 2017 at 04:27:17PM +0200, Michal Hocko wrote: > On Mon 02-10-17 16:06:33, Alexandru Moise wrote: > > On Mon, Oct 02, 2017 at 02:54:32PM +0200, Michal Hocko wrote: > > > On Mon 02-10-17 00:51:11, Alexandru Moise wrote: > > > > This attempts to bring mor

Re: [PATCH] mm,hugetlb,migration: don't migrate kernelcore hugepages

2017-10-02 Thread Alexandru Moise
On Mon, Oct 02, 2017 at 02:54:32PM +0200, Michal Hocko wrote: > On Mon 02-10-17 00:51:11, Alexandru Moise wrote: > > This attempts to bring more flexibility to how hugepages are allocated > > by making it possible to decide whether we want the hugepages to be > > allocated fr

[PATCH] mm,hugetlb,migration: don't migrate kernelcore hugepages

2017-10-01 Thread Alexandru Moise
ementation is a bit dirty so obviously I'm open to suggestions for a better way to implement this behavior, or comments whether the whole idea is fundamentally __wrong__. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- Documentation/admin-guide/kernel-parameters.txt | 8 +

Re: [PATCH] mm, hugetlb: fix "treat_as_movable" condition in htlb_alloc_mask

2017-09-30 Thread Alexandru Moise
On Fri, Sep 29, 2017 at 02:16:10PM -0700, Mike Kravetz wrote: > Adding Anshuman > > On 09/29/2017 01:43 PM, Alexandru Moise wrote: > > On Fri, Sep 29, 2017 at 05:13:39PM +0200, Alexandru Moise wrote: > >> > >> diff --git a/mm/hugetlb.c b/mm/hugetlb.c > >&g

Re: [PATCH] mm, hugetlb: fix "treat_as_movable" condition in htlb_alloc_mask

2017-09-29 Thread Alexandru Moise
On Fri, Sep 29, 2017 at 05:13:39PM +0200, Alexandru Moise wrote: > If hugepage_migration_supported() returns true, this renders the > hugepages_treat_as_movable sysctl completely pointless. > > Let's keep this behavior optional by switching the if() condition > from || to &a

[PATCH] mm, hugetlb: fix "treat_as_movable" condition in htlb_alloc_mask

2017-09-29 Thread Alexandru Moise
If hugepage_migration_supported() returns true, this renders the hugepages_treat_as_movable sysctl completely pointless. Let's keep this behavior optional by switching the if() condition from || to &&. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- mm/

Re: [PATCH] mm/madvise: enable soft offline of HugeTLB pages at PUD level

2017-09-29 Thread Alexandru Moise
On Fri, Sep 29, 2017 at 04:55:54PM +0300, Kirill A. Shutemov wrote: > On Wed, Sep 13, 2017 at 12:10:47PM +0200, Alexandru Moise wrote: > > since 94310cb we've been able to soft offline 1G hugepages at the PGD > > level, however x86_64 gigantic hugepages are at the PUD level so

[PATCH] genirq: check __free_irq()'s return value for NULL

2017-09-19 Thread Alexandru Moise
__free_irq() can return a NULL irqaction for example when trying to free already-free IRQ. Fix this by adding a check and return NULL. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- kernel/irq/manage.c | 4 1 file changed, 4 insertions(+) diff --git a/kern

[PATCH] mm/madvise: enable soft offline of HugeTLB pages at PUD level

2017-09-13 Thread Alexandru Moise
ted with 4 level pagetable. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- include/linux/hugetlb.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 8bbbd37ab105..86c3f3d9da0a 100644 --- a/include/linux/hugetlb.h +++

Re: [PATCH] mm, hugetlb, soft_offline: save compound page order before page migration

2017-09-13 Thread Alexandru Moise
On Wed, Sep 13, 2017 at 12:13:09AM +, Naoya Horiguchi wrote: > Hi Alexandru, > > On Tue, Sep 12, 2017 at 10:43:06PM +0200, Alexandru Moise wrote: > > This fixes a bug in madvise() where if you'd try to soft offline a > > hugepage via madvise(), while walking the

Re: [PATCH] mm, hugetlb, soft_offline: save compound page order before page migration

2017-09-12 Thread Alexandru Moise
On Tue, Sep 12, 2017 at 01:58:35PM -0700, Andrew Morton wrote: > On Tue, 12 Sep 2017 13:54:48 -0700 Andrew Morton > wrote: > > > On Tue, 12 Sep 2017 22:43:06 +0200 Alexandru Moise > > <00moses.alexande...@gmail.com> wrote: > > > > > This fixes a b

Re: [PATCH] mm, hugetlb, soft_offline: save compound page order before page migration

2017-09-12 Thread Alexandru Moise
On Tue, Sep 12, 2017 at 01:54:48PM -0700, Andrew Morton wrote: > On Tue, 12 Sep 2017 22:43:06 +0200 Alexandru Moise > <00moses.alexande...@gmail.com> wrote: > > > This fixes a bug in madvise() where if you'd try to soft offline a > > hugepage via madvise(), while

[PATCH] mm, hugetlb, soft_offline: save compound page order before page migration

2017-09-12 Thread Alexandru Moise
age (since c3114a8). Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- mm/madvise.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mm/madvise.c b/mm/madvise.c index 21261ff0466f..25bade36e9ca 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@

Re: [PATCH] drm: inhibit drm drivers register to uninitialized drm core

2017-07-10 Thread Alexandru Moise
On Mon, Jul 10, 2017 at 08:00:37PM +0200, Daniel Vetter wrote: > On Mon, Jul 10, 2017 at 9:14 AM, Alexandru Moise > <00moses.alexande...@gmail.com> wrote: > > On Mon, Jul 10, 2017 at 08:52:46AM +0200, Daniel Vetter wrote: > >> On Sat, Jul 08, 2017 at 11:43:52PM +

Re: [PATCH] drm: inhibit drm drivers register to uninitialized drm core

2017-07-10 Thread Alexandru Moise
On Mon, Jul 10, 2017 at 08:52:46AM +0200, Daniel Vetter wrote: > On Sat, Jul 08, 2017 at 11:43:52PM +0200, Alexandru Moise wrote: > > If the DRM core fails to init for whatever reason, ensure that > > no driver ever calls drm_dev_register(). > > > > This is best d

[PATCH] drm: inhibit drm drivers register to uninitialized drm core

2017-07-08 Thread Alexandru Moise
p->lookup() while it was NULL in debugfs at inode_lock() or lookup_*(). Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- drivers/gpu/drm/drm_drv.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c

Re: Question regarding Linux implementation of rbtrees

2017-04-14 Thread Alexandru Moise
On Fri, Apr 14, 2017 at 10:51:32AM +0200, Peter Zijlstra wrote: > On Fri, Apr 14, 2017 at 12:24:55AM +0200, Alexandru Moise wrote: > > Seeing as RB_RED is defined to be 0 in include/linux/rbtree_augmented.h > > A call of this form: rb_set_parent_color(node, parent, RB_RED);

Question regarding Linux implementation of rbtrees

2017-04-13 Thread Alexandru Moise
Seeing as RB_RED is defined to be 0 in include/linux/rbtree_augmented.h A call of this form: rb_set_parent_color(node, parent, RB_RED); as seen in __rb_insert would only end up reassigning the parent "color" (which is the parent pointer value cast to unsigned long) OR'd with 0. Which would mean tha

[PATCH] cls_u32: don't bother explicitly initializing ->divisor to zero

2017-01-08 Thread Alexandru Moise
This struct member is already initialized to zero upon root_ht's allocation via kzalloc(). Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- net/sched/cls_u32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index ae83c3a

[PATCH] devpts: remove DEVPTS_MULTIPLE_INSTANCES from all configs

2016-06-20 Thread Alexandru Moise
As each mount of devpts is now an independent filesystem, the DEVPTS_MULTIPLE_INSTANCES config option no longer exists. So remove it. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- arch/arc/configs/tb10x_defconfig| 1 - arch/arm/configs/mxs_def

Re: [PATCH v2] cfq-iosched: convert group idle time to jiffies

2015-12-29 Thread Alexandru Moise
On Tue, Dec 29, 2015 at 01:19:57PM -0700, Jens Axboe wrote: > On 12/29/2015 01:16 PM, Alexandru Moise wrote: > >This patch refers to Jens Axboe's change way back in 2006: > >7b14e3b52 cfq-iosched: slice expiry fixups > > > >In this patch he fixed a potential

[PATCH v2] cfq-iosched: convert group idle time to jiffies

2015-12-29 Thread Alexandru Moise
timer. Signed-off-by: Alexandru Moise <00moses.alexade...@gmail.com> --- V2: slice_idle not in miliseconds, convert only group_idle block/cfq-iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 1f9093e..088c45d 100644

Re: [PATCH] cfq-iosched: convert slice idle time to jiffies

2015-12-29 Thread Alexandru Moise
On Tue, Dec 29, 2015 at 10:19:17AM -0700, Jens Axboe wrote: > On 12/28/2015 06:08 PM, Alexandru Moise wrote: > >This patch refers to Jens Axboe's change way back in 2006: > >7b14e3b52 cfq-iosched: slice expiry fixups > > > >In this patch he fixed a potential

[PATCH] cfq-iosched: convert slice idle time to jiffies

2015-12-28 Thread Alexandru Moise
time but the numbers vary too much for me to post any believable numbers (10 milliseconds difference at most on average). Signed-off-by: Alexandru Moise <00moses.alexade...@gmail.com> --- block/cfq-iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/cfq-iosch

[PATCH] jbd2: redefine jbd2_get_transaction to jbd2_init_transaction

2015-11-12 Thread Alexandru Moise
-by: Alexandru Moise <00moses.alexande...@gmail.com> Reviewed-by: Jan Kara --- fs/jbd2/transaction.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index 89463ee..3fd597b 100644 --- a/fs/jbd2/transaction.c +++ b/f

[PATCH] jbd2: redefine jbd2_get_transaction to jbd2_init_transaction

2015-11-12 Thread Alexandru Moise
-by: Alexandru Moise <00moses.alexande...@gmail.com> --- fs/jbd2/transaction.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index 89463ee..3fd597b 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c @@

Re: [PATCH] btrfs: zero out delayed node upon allocation

2015-10-25 Thread Alexandru Moise
On Sun, Oct 25, 2015 at 01:33:45PM -0400, Jeff Mahoney wrote: > > On Oct 25, 2015, at 3:50 PM, Alexandru Moise <00moses.alexande...@gmail.com> > wrote: > > >>> This allows us to trim out half of btrfs_init_delayed_node() which > >>> is n

[PATCH v2] btrfs: zero out delayed node upon allocation

2015-10-25 Thread Alexandru Moise
It's slightly cleaner to zero-out the delayed node upon allocation than to do it by hand in btrfs_init_delayed_node() for a few members Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- v2: Thanks Jeff Mahoney for pointing out the mistake of removing the atomic_set i

Re: [PATCH] btrfs: zero out delayed node upon allocation

2015-10-25 Thread Alexandru Moise
> > This allows us to trim out half of btrfs_init_delayed_node() which > > is now reduntant. > > It's redundant if kmem_cache_zalloc is used, but you haven't > documented that doing so is now required. For all of these changes > you've posted, if they're to be accepted, I'd really prefer to set u

[PATCH] btrfs: pass proper enum type to start_transaction()

2015-10-25 Thread Alexandru Moise
Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- fs/btrfs/transaction.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index a5b0644..cb50f53 100644 --- a/fs/btrfs/transaction.c +++ b/fs

[PATCH] btrfs: zero out delayed node upon allocation

2015-10-25 Thread Alexandru Moise
This allows us to trim out half of btrfs_init_delayed_node() which is now reduntant. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- fs/btrfs/delayed-inode.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/d

[PATCH] mm: initialize kmem_cache pointer to NULL

2015-10-20 Thread Alexandru Moise
The assignment to NULL within the error condition was written in a 2014 patch to suppress a compiler warning. However it would be cleaner to just initialize the kmem_cache to NULL and just return it in case of an error condition. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.

[PATCH] btrfs: switch __btrfs_fs_incompat return type from int to bool

2015-10-18 Thread Alexandru Moise
Conform to __btrfs_fs_incompat() cast-to-bool (!!) by explicitly returning boolean not int. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- fs/btrfs/ctree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 9

Re: [PATCH 2/2] mm: fix declarations of nr, delta and nr_pagecache_reclaimable

2015-09-29 Thread Alexandru Moise
On Tue, Sep 29, 2015 at 10:28:57PM -0700, Andrew Morton wrote: > On Wed, 30 Sep 2015 08:10:04 +0300 Alexandru Moise > <00moses.alexande...@gmail.com> wrote: > > > > > --- a/mm/vmscan.c > > > > +++ b/mm/vmscan.c > > > > @@ -194,7 +194,7

Re: [PATCH 2/2] mm: fix declarations of nr, delta and nr_pagecache_reclaimable

2015-09-29 Thread Alexandru Moise
> > --- a/mm/vmscan.c > > +++ b/mm/vmscan.c > > @@ -194,7 +194,7 @@ static bool sane_reclaim(struct scan_control *sc) > > > > static unsigned long zone_reclaimable_pages(struct zone *zone) > > { > > - int nr; > > + unsigned long nr; > > > > nr = zone_page_state(zone, NR_ACTIVE_FILE) +

Re: [PATCH] btrfs: remove unneeded NULL initializer for struct fs_path

2015-09-29 Thread Alexandru Moise
On Tue, Sep 29, 2015 at 02:32:29PM +0200, David Sterba wrote: > On Sat, Sep 26, 2015 at 12:05:19PM +0000, Alexandru Moise wrote: > > fs_path_alloc() either returns an alloc'ed struct fs_path > > or NULL, no need to initialize the pointer to NULL. > > > >

Re: [PATCH 1/2] mm: change free_cma and free_pages declarations to unsigned

2015-09-29 Thread Alexandru Moise
On Tue, Sep 29, 2015 at 11:13:27AM +0100, Mel Gorman wrote: > On Sun, Sep 27, 2015 at 09:04:16PM +0000, Alexandru Moise wrote: > > Their stored values come from zone_page_state() which returns > > an unsigned long. To improve code correctness we should avoid > > mixing signed

[PATCH 2/2] mm: fix declarations of nr, delta and nr_pagecache_reclaimable

2015-09-27 Thread Alexandru Moise
age_state() and zone_unmapped_file_pages() which also happen to return unsigned integers. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- mm/vmscan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 7f63a93..41e254e 100

[PATCH 1/2] mm: change free_cma and free_pages declarations to unsigned

2015-09-27 Thread Alexandru Moise
Their stored values come from zone_page_state() which returns an unsigned long. To improve code correctness we should avoid mixing signed and unsigned integers. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions

[PATCH] btrfs: remove unneeded NULL initializer for struct fs_path

2015-09-26 Thread Alexandru Moise
fs_path_alloc() either returns an alloc'ed struct fs_path or NULL, no need to initialize the pointer to NULL. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- fs/btrfs/send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/send.c b/fs/b

[PATCH v2 1/2] btrfs: change num_items type from u64 to unsigned int

2015-09-22 Thread Alexandru Moise
The value of num_items that start_transaction() ultimately always takes is a small one, so a 64 bit integer is overkill. Also change num_items for btrfs_start_transaction() and btrfs_start_transaction_lflush() as well. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com>

[PATCH v2 2/2] btrfs: declare rsv_count as unsigned int instead of int

2015-09-22 Thread Alexandru Moise
rsv_count ultimately gets passed to start_transaction() which now takes an unsigned int as its num_items parameter. The value of rsv_count should always be positive so declare it as being unsigned. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- v2: followed dave's

[PATCH v2] btrfs: cleanup btrfs_balance profile validity checks

2015-09-22 Thread Alexandru Moise
Improve readability by generalizing the profile validity checks. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- v2: Followed Dave's suggestion and renamed function to validate_convert_profile instead of balance_relocate_invalid fs/btrfs/vol

Re: [PATCH 1/2] btrfs: avoid passing int param to start_transaction which takes u64

2015-09-22 Thread Alexandru Moise
On Tue, Sep 22, 2015 at 03:09:33PM +0200, David Sterba wrote: > On Sun, Sep 13, 2015 at 06:47:20PM +0000, Alexandru Moise wrote: > > Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> > > --- > > v2: Forgot to add transaction.h when I made the commit,

Re: [PATCH] btrfs: memset cur_trans->delayed_refs to zero

2015-09-22 Thread Alexandru Moise
On Tue, Sep 22, 2015 at 03:04:54PM +0200, David Sterba wrote: > On Mon, Sep 07, 2015 at 05:24:37PM +0300, Alexandru Moise wrote: > > Use memset() to null out the btrfs_delayed_ref_root of > > btrfs_transaction instead of setting all the members to 0 by hand. > > > > Sig

Re: [PATCH 1/2] btrfs: avoid passing int param to start_transaction which takes u64

2015-09-13 Thread Alexandru Moise
On Sun, Sep 13, 2015 at 02:53:14PM +, Holger Hoffstätte wrote: > On Sun, 13 Sep 2015 14:29:41 +0000, Alexandru Moise wrote: > > > Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> > > --- > > fs/btrfs/transaction.c | 2 +- > > 1 file

[PATCH 1/2] btrfs: avoid passing int param to start_transaction which takes u64

2015-09-13 Thread Alexandru Moise
Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- v2: Forgot to add transaction.h when I made the commit, many thanks Holger for pointing it out. fs/btrfs/transaction.c | 2 +- fs/btrfs/transaction.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs

Re: [PATCH 1/2] btrfs: avoid passing int param to start_transaction which takes u64

2015-09-13 Thread Alexandru Moise
On Sun, Sep 13, 2015 at 02:53:14PM +, Holger Hoffstätte wrote: > On Sun, 13 Sep 2015 14:29:41 +0000, Alexandru Moise wrote: > > > Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> > > --- > > fs/btrfs/transaction.c | 2 +- > > 1 file

[PATCH 2/2] btrfs: declare rsv_count as u64 instead of int

2015-09-13 Thread Alexandru Moise
This patch completes the 2-patches patch series which modifies btrfs_start_transaction() to receive an u64 as its "num_items" parameter thus avoiding to pass an int to start_transaction() which actually takes an u64. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com&g

[PATCH 1/2] btrfs: avoid passing int param to start_transaction which takes u64

2015-09-13 Thread Alexandru Moise
Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- fs/btrfs/transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 8f259b3..8a83acd 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transac

[PATCH] btrfs: use a single if() statement for one outcome in get_block_rsv()

2015-09-08 Thread Alexandru Moise
Rather than have three separate if() statements for the same outcome we should just OR them together in the same if() statement. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- fs/btrfs/extent-tree.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff

[PATCH] btrfs: memset cur_trans->delayed_refs to zero

2015-09-07 Thread Alexandru Moise
Use memset() to null out the btrfs_delayed_ref_root of btrfs_transaction instead of setting all the members to 0 by hand. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- Rather than setting each member of ->delayed_refs by hand we should adhere to the practice of usi

Re: [PATCH] btrfs: memset cur_trans->delayed_refs to zero

2015-09-07 Thread Alexandru Moise
On Mon, Sep 07, 2015 at 04:01:22PM +0200, David Sterba wrote: > So, updated patches should mention that in the subject eg: > > [PATCH v2] btrfs: memset cur_trans->delayed_refs to zero > > On Mon, Sep 07, 2015 at 04:45:02PM +0300, Alexandru Moise wrote: > > Use

[PATCH] btrfs: memset cur_trans->delayed_refs to zero

2015-09-07 Thread Alexandru Moise
Use memset() to null out the btrfs_delayed_ref_root of btrfs_transaction instead of setting all the members to 0 by hand. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- fs/btrfs/transaction.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --gi

Re: [PATCH] btrfs: memset cur_trans->delayed_refs to zero

2015-09-07 Thread Alexandru Moise
On Mon, Sep 07, 2015 at 02:24:20PM +0200, David Sterba wrote: > On Sun, Sep 06, 2015 at 12:25:27PM +0000, Alexandru Moise wrote: > > Use memset() to null out the btrfs_delayed_ref_root of > > btrfs_transaction instead of setting all the members to 0 by hand. > > > > Sig

[PATCH] btrfs: memset cur_trans->delayed_refs to zero

2015-09-06 Thread Alexandru Moise
Use memset() to null out the btrfs_delayed_ref_root of btrfs_transaction instead of setting all the members to 0 by hand. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- fs/btrfs/transaction.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --gi

Re: [PATCH] btrfs: Remove unneeded cast to s64 for qgroup rfer state

2015-08-30 Thread Alexandru Moise
On Mon, Aug 31, 2015 at 02:51:08PM +0800, Qu Wenruo wrote: > > > Alexandru Moise wrote on 2015/08/31 09:32 +0300: > >On Mon, Aug 31, 2015 at 09:44:49AM +0800, Qu Wenruo wrote: > >>>>>From the perspective of users, qgroup's referenced or exclusive

Re: [PATCH] btrfs: Remove unneeded cast to s64 for qgroup rfer state

2015-08-30 Thread Alexandru Moise
On Mon, Aug 31, 2015 at 09:44:49AM +0800, Qu Wenruo wrote: > >>>From the perspective of users, qgroup's referenced or exclusive > >>is negative,but user can not continue to write data! a workaround > >>way is to cast u64 to s64 when doing qgroup reservation > > > >I am unable to reprodu

[PATCH] btrfs: cleanup btrfs_balance profile validity checks

2015-08-30 Thread Alexandru Moise
Improve readability by generalizing the profile validity checks, I had to read through those if statements half a dozen times on my first try just to get an idea of what's happening there. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- fs/btrfs/vol

[PATCH] btrfs: Remove unneeded cast to s64 for qgroup rfer state

2015-08-29 Thread Alexandru Moise
or exclusive >is negative,but user can not continue to write data! a workaround >way is to cast u64 to s64 when doing qgroup reservation I am unable to reproduce this problem without his modification. I could be wrong in reverting this, so I'm gonna CC Wang as well so he is aware of thi

Re: [PATCH] btrfs: trimming some start_transaction() code away

2015-08-28 Thread Alexandru Moise
On Fri, Aug 28, 2015 at 07:38:56PM +0200, David Sterba wrote: > On Thu, Aug 27, 2015 at 11:53:45PM +0000, Alexandru Moise wrote: > > Just call kmem_cache_zalloc() instead of calling kmem_cache_alloc(). > > We're just initializing most fields to 0, false and NULL later on >

[PATCH] btrfs: trimming some start_transaction() code away

2015-08-27 Thread Alexandru Moise
zeros on allocation then just initialize those five remaining fields (not counting the list_heads) as normal. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- fs/btrfs/transaction.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git

[PATCH] btrfs: Fixed declaration of old_len

2015-08-24 Thread Alexandru Moise
old_len is used to store the return value of btrfs_item_size_nr(). The return value of btrfs_item_size_nr() is of type u32. To improve code correctness and avoid mixing signed and unsigned integers I've changed old_len to be of type u32 as well. Signed-off-by: Alexandru Moise <00moses.

[PATCH] btrfs: Fixed dsize and last_off declarations

2015-08-23 Thread Alexandru Moise
The return values of btrfs_item_offset_nr and btrfs_item_size_nr are of type u32. To avoid mixing signed and unsigned integers we should also declare dsize and last_off to be of type u32. Signed-off-by: Alexandru Moise <00moses.alexande...@gmail.com> --- fs/btrfs/ctree.c | 4 ++-- 1 file c