Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754452AbZGFFgT (ORCPT ); Mon, 6 Jul 2009 01:36:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751528AbZGFFgI (ORCPT ); Mon, 6 Jul 2009 01:36:08 -0400 Received: from mx2.redhat.com ([66.187.237.31]:40051 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751393AbZGFFgH (ORCPT ); Mon, 6 Jul 2009 01:36:07 -0400 Date: Mon, 6 Jul 2009 01:35:30 -0400 From: Amerigo Wang To: linux-kernel@vger.kernel.org Cc: Heiko Carstens , Amerigo Wang , linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org, Al Viro , Miklos Szeredi Message-Id: <20090706053745.6338.50777.sendpatchset@localhost.localdomain> Subject: [Patch] pipe: use file_update_time() when hold i_mutex Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 930 Lines: 36 file_update_time() should be called with i_mutex held, move it before mutex_unlock(). Signed-off-by: WANG Cong Cc: Al Viro Cc: Heiko Carstens Cc: Miklos Szeredi --- diff --git a/fs/pipe.c b/fs/pipe.c index f7dd21a..724b035 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -602,13 +602,14 @@ redo2: pipe->waiting_writers--; } out: + if (ret > 0) + file_update_time(filp); + mutex_unlock(&inode->i_mutex); if (do_wakeup) { wake_up_interruptible_sync(&pipe->wait); kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); } - if (ret > 0) - file_update_time(filp); return ret; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/