[PATCH]jffs2:bugfix for should not appeared directory hard link

Brian Norris computersforpeace at gmail.com
Wed Nov 5 03:45:00 PST 2014


On Fri, Oct 24, 2014 at 05:26:05PM +0800, liu.song11 at zte.com.cn wrote:
> hi everyone

Hi!

> When jffs2 with summary, during the mounting period, in 
> jffs2_build_remove_unlinked_inode will
> handle unlinke inode, but this will cause unlinked directory's deletion 
> dirent erased before
> it's obsoleted dirent.So if the directory has renamed, then could cause a 
> hard link when we 
> remount jffs2.
> We can stable reproduce the hard link only by following process.
> 1. we mount jffs2 in /mnt
> 2. create directories /mnt/SW1/, /mnt/SW2/
> 3. create directory /mnt/old/
> 4. rename /mnt/SW1/ to /mnt/old/SW1/, /mnt/SW2/ to /mnt/old/SW2/
> 5. do some data write. don't touch these directories.
> 6. rename /mnt/old/SW1/ to /mnt/SW1/, /mnt/old/SW2/ to /mnt/SW2/
> 7. delete /mnt/old/
> 
> do above process 3 - 7 several times, then reboot, during the mounting 
> process, we could found
> /mnt/SW1/ and /mnt/old/SW1/ become hard link,/mnt/SW2/ and /mnt/old/SW2/ 
> become hard link. So we
> do some job to fix this bug.We have tested this patch and the hard link 
> error will never occur.
> Thanks!
> Best Regards

This only describes the problem, but it doesn't describe the fix at all.
Please provide a proper commit description.

Also, your patch is very big and line-wrapped, so it's very hard to
figure out what it's doing, and it won't apply to my git tree. Please
check your mailer settings.

All this is addressed in Documentation/SubmittingPatches, which I
suggest you read.

Regards,
Brian



More information about the linux-mtd mailing list