Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758125AbXERKfZ (ORCPT ); Fri, 18 May 2007 06:35:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755809AbXERKfP (ORCPT ); Fri, 18 May 2007 06:35:15 -0400 Received: from mail-gw3.sa.ew.hu ([212.108.200.82]:59059 "EHLO mail-gw3.sa.ew.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755705AbXERKfN (ORCPT ); Fri, 18 May 2007 06:35:13 -0400 To: akpm@linux-foundation.org CC: linux-kernel@vger.kernel.org Subject: [patch 1/2] fuse: generic_write_checks() for direct_io Message-Id: From: Miklos Szeredi Date: Fri, 18 May 2007 12:34:20 +0200 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1128 Lines: 37 Andrew, These are for 2.6.22, please apply. Thanks. ---- From: Miklos Szeredi This fixes O_APPEND in direct IO mode. Also checks writes against file size limits, notably rlimits. Reported by Greg Bruno. Signed-off-by: Miklos Szeredi --- Index: linux/fs/fuse/file.c =================================================================== --- linux.orig/fs/fuse/file.c 2007-04-26 12:54:32.000000000 +0200 +++ linux/fs/fuse/file.c 2007-05-02 20:17:27.000000000 +0200 @@ -609,7 +609,9 @@ static ssize_t fuse_direct_write(struct ssize_t res; /* Don't allow parallel writes to the same file */ mutex_lock(&inode->i_mutex); - res = fuse_direct_io(file, buf, count, ppos, 1); + res = generic_write_checks(file, ppos, &count, 0); + if (!res) + res = fuse_direct_io(file, buf, count, ppos, 1); mutex_unlock(&inode->i_mutex); return res; } - 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/