From: Pat LaVarre Subject: udf.ko patchable Date: 01 Dec 2003 09:02:37 -0700 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <1070294557.2381.37.camel@patrh9> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: Received: from email-out1.iomega.com ([147.178.1.82]:59895 "EHLO email.iomega.com") by vger.kernel.org with ESMTP id S263526AbTLAQC7 (ORCPT ); Mon, 1 Dec 2003 11:02:59 -0500 Received: from royntex01.iomegacorp.com (unknown [147.178.90.120]) by email.iomega.com (Postfix) with ESMTP id A86A32054 for ; Mon, 1 Dec 2003 09:02:58 -0700 (MST) To: linux-fsdevel@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Kindly offline I see udf.ko patches such as the following suggested. I'm as yet too ignorant to find this patch obviously correct - so likewise I cannot yet myself hope to discover similar enhancements nearby in the code - but perhaps you other more capable people might find this concrete example sparks your interest? Pat LaVarre diff -Nurp linux-2.6.0-test11/fs/udf/inode.c linux/fs/udf/inode.c --- linux-2.6.0-test11/fs/udf/inode.c 2003-11-26 13:46:12.000000000 -0700 +++ linux/fs/udf/inode.c 2003-11-29 14:54:25.588696536 -0700 @@ -84,9 +84,11 @@ void udf_put_inode(struct inode * inode) { if (!(inode->i_sb->s_flags & MS_RDONLY)) { + down(&inode->i_sem); lock_kernel(); udf_discard_prealloc(inode); unlock_kernel(); + up(&inode->i_sem); } } @@ -1625,7 +1627,7 @@ int8_t udf_add_aext(struct inode *inode, int err, loffset; lb_addr obloc = *bloc; - if (!(bloc->logicalBlockNum = udf_new_block(inode->i_sb, inode, + if (!(bloc->logicalBlockNum = udf_new_block(inode->i_sb, NULL, obloc.partitionReferenceNum, obloc.logicalBlockNum, &err))) { return -1; @@ -1833,7 +1835,7 @@ int8_t udf_current_aext(struct inode *in if (!(*extoffset)) *extoffset = sizeof(struct allocExtDesc); ptr = (*bh)->b_data + *extoffset; - alen = le32_to_cpu(((struct allocExtDesc *)(*bh)->b_data)->lengthAllocDescs); + alen = sizeof(struct allocExtDesc) + le32_to_cpu(((struct allocExtDesc *)(*bh)->b_data)->lengthAllocDescs); } switch (UDF_I_ALLOCTYPE(inode))