Hello, > Hi. I have a question on __log_wait_for_space() in jbd/checkpoint.c > while I read jbd code of Linux 2.6.30.4 > > In __log_wait_for_space(), it releases and re-takes journal->j_state_lock > in while loop (at line 139). > > After the retaking the lock, it checks 'space_left < nblocks'. It seems that > it considers that the journal might be written during the lock > releasing and re-taking. > > Then, is it necessary to check 'journal->j_flags & JFS_ABORT' again too? > I found that journal_t's j_flags is synchronized via j_state_lock. So, is there > any possiblity that j_flags value can be changed during the lock > releasing and re-taking? Well, it may happen that JFS_ABORT has been set while we didn't hold j_state_lock but I don't see a problem in it. We just call a few other functions and then reiterate the while loop and we exit the loop either because there is enough space in the journal or becauce we notice the JFS_ABORT flag. The point of JFS_ABORT check is that we didn't loop indefinitely when the journal gets aborted and no blocks can be freed. Honza -- Jan Kara <jack@xxxxxxx> SuSE CR Labs -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html