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

2013-06-27 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

Re: [Ocfs2-devel] [PATCH] ocfs2: fix readonly issue in ocfs2_unlink()

2013-06-27 Thread Jeff Liu
On 06/28/2013 01:52 PM, Younger Liu wrote: > On 2013/6/28 5:58, Andrew Morton wrote: >> On Thu, 27 Jun 2013 11:05:40 +0800 Younger Liu >> wrote: >> >>> While deleting a file with ocfs2_unlink(), there is a bug in this >>> function. This bug will result in filesystem read-only. >>> >>> After cal

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

2013-06-27 Thread Younger Liu
On 2013/6/27 5:49, Andrew Morton wrote: > On Thu, 20 Jun 2013 15:59:30 +0800 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 >> orp

Re: [Ocfs2-devel] [PATCH] ocfs2: fix readonly issue in ocfs2_unlink()

2013-06-27 Thread Younger Liu
On 2013/6/28 5:58, Andrew Morton wrote: > On Thu, 27 Jun 2013 11:05:40 +0800 Younger Liu wrote: > >> While deleting a file with ocfs2_unlink(), there is a bug in this >> function. This bug will result in filesystem read-only. >> >> After calling ocfs2_orphan_add(), the file which will be deleted

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

2013-06-27 Thread Jeff Liu
On 06/28/2013 10:11 AM, Jensen wrote: > it looks good , but it is better that if moving the following two sentence to > before 'ocfs2_journal_dirty(handle, fe_bh);' sentence. > 1.ocfs2_journal_dirty(handle, prev_bg_bh); > 2.ocfs2_journal_dirty(handle, bg_bh); Thanks for your review, but are you

Re: [Ocfs2-devel] [PATCH] ocfs2: fix issue that ocfs2_setattr() does not deal with new_i_size==i_size

2013-06-27 Thread Jeff Liu
Thanks for your patch, it indeed fixed a bug. However, your description is not correct, please see my inline comments. On 06/27/2013 03:55 PM, Younger Liu wrote: > The issue scenario is as following: > 1. fallocate a large disk space(eg. 30G) with FALLOC_FL_KEEP_SIZE > for a file whose i_size an

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

2013-06-27 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 v2] ocfs2: Rework transaction rollback in ocfs2_relink_block_group()

2013-06-27 Thread Jensen
it looks good , but it is better that if moving the following two sentence to before 'ocfs2_journal_dirty(handle, fe_bh);' sentence. 1.ocfs2_journal_dirty(handle, prev_bg_bh); 2.ocfs2_journal_dirty(handle, bg_bh); because if it fail, it maybe commit by jbd2 journal. Thanks, Jensen On 2013/6/20

Re: [Ocfs2-devel] [PATCH] ocfs2: fix issue that ocfs2_setattr() does not deal with new_i_size==i_size

2013-06-27 Thread Jensen
It looks good to me. reviewed-by: Jensen On 2013/6/27 15:55, Younger Liu wrote: > The issue scenario is as following: > 1. fallocate a large disk space(eg. 30G) with FALLOC_FL_KEEP_SIZE > for a file whose i_size and disk size are 512(or other size). > After executing fallocate, i_size file is

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

2013-06-27 Thread Junxiao Bi
Hi Andrew, On 06/28/2013 07:08 AM, Andrew Morton wrote: > On Fri, 21 Jun 2013 09:27:24 +0800 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 ocfs

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

2013-06-27 Thread Andrew Morton
On Fri, 21 Jun 2013 09:27:24 +0800 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] ocfs2: llseek requires to ocfs2 inode lock for the file in SEEK_END

2013-06-27 Thread Sunil Mushran
The qs is whether this change is required for a real problem or not. If so, what is that logic that gets tripped up by this behaviour. On Thu, Jun 27, 2013 at 3:08 PM, Andrew Morton wrote: > On Wed, 26 Jun 2013 20:34:19 -0700 Sunil Mushran > wrote: > > > AFAIR, this behavior has been there sinc

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

2013-06-27 Thread Andrew Morton
On Wed, 26 Jun 2013 20:34:19 -0700 Sunil Mushran wrote: > AFAIR, this behavior has been there since day 1 and changing it will impact > performance negatively. I would recommend against making this change for > one app. Well, it's a bug fix isn't it? SEEK_END on a 15k file is presently returni

Re: [Ocfs2-devel] [PATCH] ocfs2: fix readonly issue in ocfs2_unlink()

2013-06-27 Thread Andrew Morton
On Thu, 27 Jun 2013 11:05:40 +0800 Younger Liu wrote: > While deleting a file with ocfs2_unlink(), there is a bug in this > function. This bug will result in filesystem read-only. > > After calling ocfs2_orphan_add(), the file which will be deleted > is added into orphan dir. If ocfs2_delete_e

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

2013-06-27 Thread Jensen
On 2013/6/27 11:34, Sunil Mushran wrote: > AFAIR, this behavior has been there since day 1 and changing it will impact > performance negatively. I would recommend against making this > change for one app. > I think it will impact the performance negatively. but I think it is very very little, b

[Ocfs2-devel] [PATCH] ocfs2: fix issue that ocfs2_setattr() does not deal with new_i_size==i_size

2013-06-27 Thread Younger Liu
The issue scenario is as following: 1. fallocate a large disk space(eg. 30G) with FALLOC_FL_KEEP_SIZE for a file whose i_size and disk size are 512(or other size). After executing fallocate, i_size file is still 512, and the disk size became to 30G+512; 2. ftruncate the file to new_i_size which e