Re: [Ocfs2-devel] [PATCH] ocfs2: dlmlock_master should return DLM_NORMAL after adding lock to blocked list

2013-06-20 Thread shencanquan
it is fine. because when the lock add to the block list. it should be return DLM_NORMAL. Reviewed-by: jensen On 2013/6/20 19:13, Xue jiufei wrote: > Function dlmlock_master() returns DLM_RECOVERING/DLM_MIGRATING/ > DLM_FORWAR after adding lock to blocked list if lockres has the state > DLM_LOCK_

[Ocfs2-devel] [PATCH V2] ocfs2: xattr: fix inlined xattr reflink

2013-06-20 Thread Junxiao Bi
Inlined xattr shared free space of inode block with inlined data or data extent record, so the size of the later two should be adjusted when inlined xattr is enabled. See ocfs2_xattr_ibody_init(). But this isn't done well when reflink. For inode with inlined data, its max inlined data size is adjus

Re: [Ocfs2-devel] [PATCH] fs/jbd2: t_updates should increase when start_this_handle() failed in jbd2__journal_restart()

2013-06-20 Thread Theodore Ts'o
On Thu, Jun 20, 2013 at 01:26:09PM -0400, Josef Bacik wrote: > I realize it's been a little bit since I've looked at jbd but I'll offer my > opinion. Callers of jbd2_journal_restart() may not be the ones who originated > the handle, so doing what Jan has done with jbd2_journal_start_reserved() >

[Ocfs2-devel] [PATCH] jbd2: fix theoretical race in jbd2__journal_restart

2013-06-20 Thread Theodore Ts'o
Once we decrement transaction->t_updates, if this is the last handle holding the transaction from closing, and once we release the t_handle_lock spinlock, it's possible for the transaction to commit and be released. In practice with normal kernels, this probably won't happen, since the commit happ

Re: [Ocfs2-devel] [PATCH] fs/jbd2: t_updates should increase when start_this_handle() failed in jbd2__journal_restart()

2013-06-20 Thread Theodore Ts'o
[ LKML and linux-fsdevel BCC'ed ] On Wed, Jun 19, 2013 at 12:48:26PM +0800, Younger Liu wrote: > jbd2_journal_restart() would restart a handle. In this function, it > calls start_this_handle(). Before calling start_this_handle(),subtract > 1 from transaction->t_updates. > If start_this_handle() su

[Ocfs2-devel] [PATCH] ocfs2: should call ocfs2_journal_access_di() before ocfs2_delete_entry() in ocfs2_orphan_del()

2013-06-20 Thread Younger Liu
While deleting a file into orphan dir in ocfs2_orphan_del(), it calls ocfs2_delete_entry() before ocfs2_journal_access_di(). If ocfs2_delete_entry() succeeded and ocfs2_journal_access_di() failed, there would be a inconsistency: the file is deleted from orphan dir, but orphan dir dinode is not

Re: [Ocfs2-devel] [PATCH v2] ocfs2: Rework transaction rollback in ocfs2_relink_block_group()

2013-06-20 Thread Younger Liu
On 2013/6/20 13:29, Jeff Liu wrote: > From: Jie Liu > > In ocfs2_relink_block_group(), we roll back all those changes if > notify intent to modify buffers for metadata update failed even > if the relevant buffer has not yet been modified/got dirty at that > point, that are not quite right because

[Ocfs2-devel] [PATCH] ocfs2: dlmlock_master should return DLM_NORMAL after adding lock to blocked list

2013-06-20 Thread Xue jiufei
Function dlmlock_master() returns DLM_RECOVERING/DLM_MIGRATING/ DLM_FORWAR after adding lock to blocked list if lockres has the state DLM_LOCK_RES_RECOVERING/DLM_LOCK_RES_MIGRATING/ DLM_LOCK_RES_IN_PROGRESS. so it will retry in dlmlock(). And this may cause dlm_thread fall into an infinite loop

Re: [Ocfs2-devel] [PATCH 1/2] ocfs2: xattr: fix inlined xattr reflink

2013-06-20 Thread Junxiao Bi
Hi Jeff, On 06/20/2013 05:01 PM, Jeff Liu wrote: > Hi Junxiao, > > On 06/20/2013 02:17 PM, Junxiao Bi wrote: > >> Inlined xattr shared free space of inode block with inlined data >> or data extent record, so the size of the later two should be >> adjusted when inlined xattr is enabled. See ocfs2_x

Re: [Ocfs2-devel] [PATCH 1/2] ocfs2: xattr: fix inlined xattr reflink

2013-06-20 Thread Jeff Liu
Hi Junxiao, On 06/20/2013 02:17 PM, Junxiao Bi wrote: > Inlined xattr shared free space of inode block with inlined data > or data extent record, so the size of the later two should be > adjusted when inlined xattr is enabled. See ocfs2_xattr_ibody_init(). > But this isn't done well when reflink.

Re: [Ocfs2-devel] [PATCH 2/2] ocfs2: xattr: remove useless free space checking

2013-06-20 Thread Jeff Liu
On 06/20/2013 02:17 PM, Junxiao Bi wrote: > free space checking will be done in ocfs2_xattr_ibody_init(). > So remove here. > > Signed-off-by: Junxiao Bi Reviewed-by: Jie Liu > --- > fs/ocfs2/xattr.c |7 --- > 1 file changed, 7 deletions(-) > > diff --git a/fs/ocfs2/xattr.c b/fs/ocf

Re: [Ocfs2-devel] [PATCH V2] ocfs2: need rollback when journal_access failed in ocfs2_orphan_add()

2013-06-20 Thread Younger Liu
On 2013/6/20 15:59, Younger Liu wrote: > While adding a file into orphan dir in ocfs2_orphan_add(), > it calls __ocfs2_add_entry() before ocfs2_journal_access_di(). > If ocfs2_journal_access_di() failed, the file is added into > orphan dir, and orphan dir dinode updated, but file dinode > has no

[Ocfs2-devel] [PATCH] ocfs2: llseek requires to ocfs2 inode lock for the file in SEEK_END

2013-06-20 Thread shencanquan
llseek requires ocfs2 inode lock for updating the file size in SEEK_END. because the file size maybe update on another node. if it not . after call llseek in SEEK_END. the position is old. this bug can be reproduce the following scenario: at first ,we dd a test fileA,the file size is 10k. on NodeA

[Ocfs2-devel] [PATCH V2] ocfs2: need rollback when journal_access failed in ocfs2_orphan_add()

2013-06-20 Thread Younger Liu
While adding a file into orphan dir in ocfs2_orphan_add(), it calls __ocfs2_add_entry() before ocfs2_journal_access_di(). If ocfs2_journal_access_di() failed, the file is added into orphan dir, and orphan dir dinode updated, but file dinode has not been updated. Accordingly, the data is not cons