Skip to contentSkip to conversation

udf.ko patchable

PATCH Pat LaVarre 1 participant 1 message Dec 1, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

fs/udf/inode.c +4 -2
diff -Nurp linux-2.6.0-test11/fs/udf/inode.c linux/fs/udf/inode.c
@@ -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))