From: yangsheng Date: Tue, 15 Jun 2010 08:15:18 +0000 (+0800) Subject: b=22911 Don't clean EXTENTS_FL flag. X-Git-Tag: v1_8_3_54~14 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=144e5312525d78a08eb46c56c5ba2259f80ff71d;p=fs%2Flustre-release.git b=22911 Don't clean EXTENTS_FL flag. i=adilger i=girish --- diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index fa60c43..cde939b 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -642,9 +642,21 @@ static int fsfilt_ext3_iocontrol(struct inode *inode, struct file *file, ENTRY; /* FIXME: Can't do this because of nested transaction deadlock */ - if (cmd == EXT3_IOC_SETFLAGS && (*(int *)arg) & EXT3_JOURNAL_DATA_FL) { - CERROR("can't set data journal flag on file\n"); - RETURN(-EPERM); + if (cmd == EXT3_IOC_SETFLAGS) { + /* We can't enable data journaling on OST objects, because + * this forces the transaction to be closed in order to + * flush the journal, but the caller will already have a + * compound transaction open to update the last_rcvd file, + * and this thread would deadlock trying to set the flag. */ + if ((*(int *)arg) & EXT3_JOURNAL_DATA_FL) { + CERROR("can't set data journal flag on file\n"); + RETURN(-EPERM); + } + /* Because the MDS does not see the EXTENTS_FL set on the + * OST objects, mask this flag into all set flags. It is + * not legal to clear this flag in any case, so we are not + * changing the functionality by doing this. b=22911 */ + *(int *)arg |= EXT3_I(inode)->i_flags & EXT3_EXTENTS_FL; } #ifdef HAVE_EXT4_LDISKFS