diff options
-rw-r--r-- | fs/gfs2/log.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 27e97d3de1e0..b9889ae5fd7c 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -538,9 +538,12 @@ static void gfs2_ordered_write(struct gfs2_sbd *sdp) list_sort(NULL, &sdp->sd_log_le_ordered, &ip_cmp); while (!list_empty(&sdp->sd_log_le_ordered)) { ip = list_entry(sdp->sd_log_le_ordered.next, struct gfs2_inode, i_ordered); - list_move(&ip->i_ordered, &written); - if (ip->i_inode.i_mapping->nrpages == 0) + if (ip->i_inode.i_mapping->nrpages == 0) { + test_and_clear_bit(GIF_ORDERED, &ip->i_flags); + list_del(&ip->i_ordered); continue; + } + list_move(&ip->i_ordered, &written); spin_unlock(&sdp->sd_ordered_lock); filemap_fdatawrite(ip->i_inode.i_mapping); spin_lock(&sdp->sd_ordered_lock); |