From: Al Viro Date: Tue, 31 Mar 2015 16:30:48 +0000 (-0400) Subject: acct: check FMODE_CAN_WRITE X-Git-Tag: firefly_0821_release~176^2~1853^2~70 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d0f88f8d5da674445f23ace60bb1896f4a3a3783;p=firefly-linux-kernel-4.4.55.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;