From: Al Viro Date: Tue, 31 Mar 2015 16:30:48 +0000 (-0400) Subject: acct: check FMODE_CAN_WRITE X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d0f88f8d5da674445f23ace60bb1896f4a3a3783;p=openwrt%2Fstaging%2Fblogic.git acct: check FMODE_CAN_WRITE it's not calling ->write() directly anymore. Signed-off-by: Al Viro --- diff --git a/kernel/acct.c b/kernel/acct.c index e6c10d1a4058..74963d192c5d 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -213,7 +213,7 @@ static int acct_on(struct filename *pathname) return -EACCES; } - if (!file->f_op->write) { + if (!(file->f_mode & FMODE_CAN_WRITE)) { kfree(acct); filp_close(file, NULL); return -EIO;