[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1243893048-17031-22-git-send-email-ebiederm@xmission.com>
Date: Mon, 1 Jun 2009 14:50:47 -0700
From: "Eric W. Biederman" <ebiederm@...ssion.com>
To: Al Viro <viro@...IV.linux.org.uk>
Cc: <linux-kernel@...r.kernel.org>, <linux-pci@...r.kernel.org>,
<linux-mm@...ck.org>, <linux-fsdevel@...r.kernel.org>,
Hugh Dickins <hugh@...itas.com>, Tejun Heo <tj@...nel.org>,
Alexey Dobriyan <adobriyan@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Greg Kroah-Hartman <gregkh@...e.de>,
Nick Piggin <npiggin@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Christoph Hellwig <hch@...radead.org>,
"Eric W. Biederman" <ebiederm@...well.aristanetworks.com>,
"Eric W. Biederman" <ebiederm@...stanetworks.com>
Subject: [PATCH 22/23] vfs: Teach fadvice to file_hotplug_lock
From: Eric W. Biederman <ebiederm@...well.aristanetworks.com>
Signed-off-by: Eric W. Biederman <ebiederm@...stanetworks.com>
---
mm/fadvise.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/mm/fadvise.c b/mm/fadvise.c
index 54a0f80..d7f1fba 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -38,6 +38,11 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
if (!file)
return -EBADF;
+ ret = -EIO;
+ if (!file_hotplug_read_trylock(file))
+ goto out_fput;
+
+ ret = 0;
if (S_ISFIFO(file->f_path.dentry->d_inode->i_mode)) {
ret = -ESPIPE;
goto out;
@@ -123,6 +128,8 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
ret = -EINVAL;
}
out:
+ file_hotplug_read_unlock(file);
+out_fput:
fput(file);
return ret;
}
--
1.6.3.1.54.g99dd.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists