[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230829130327.GA26482@lst.de>
Date: Tue, 29 Aug 2023 15:03:27 +0200
From: Christoph Hellwig <hch@....de>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
"Darrick J. Wong" <djwong@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Matthew Wilcox <willy@...radead.org>,
Christian Brauner <christian@...uner.io>,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-xfs@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/6] block: open code __generic_file_write_iter for
blkdev writes
On Tue, Aug 29, 2023 at 03:06:14AM +0100, Al Viro wrote:
> On Tue, Aug 01, 2023 at 07:21:58PM +0200, Christoph Hellwig wrote:
> > @@ -569,7 +594,23 @@ static ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from)
> > iov_iter_truncate(from, size);
> > }
> >
> > - ret = __generic_file_write_iter(iocb, from);
> > + ret = file_remove_privs(file);
> > + if (ret)
> > + return ret;
>
> That chunk is a bit of a WTF generator... Thankfully,
>
> static int __file_remove_privs(struct file *file, unsigned int flags)
> {
> struct dentry *dentry = file_dentry(file);
> struct inode *inode = file_inode(file);
> int error = 0;
> int kill;
>
> if (IS_NOSEC(inode) || !S_ISREG(inode->i_mode))
> return 0;
>
> means that it's really a no-op. But I'd still suggest
> removing it, just to reduce the amount of head-scratching
> for people who'll be reading that code later...
I'll send an incremental patch to remove it once the changes hit
Linus' tree.
Powered by blists - more mailing lists