Re: [PATCH 1/3] xfs: check that the mountpoint is actually mounted in _supports_xfs_scrub

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 11, 2024 at 06:25:56PM +0100, Christoph Hellwig wrote:
> On Thu, Jan 11, 2024 at 09:20:22AM -0800, Darrick J. Wong wrote:
> > > +	mountpoint $mountpoint >/dev/null || echo "$mountpoint is not mounted"
> > 
> > The helper needs to return nonzero on failure, e.g.
> > 
> > 	if ! mountpoint -q $mountpoint; then
> > 		echo "$mountpoint is not mounted"
> > 		return 1
> > 	fi
> 
> No, it doesn't..  I actually did exactly that first, but that causes the
> test to be _notrun instead of reporting the error and thus telling the
> author that they usage of this helper is wrong.

So below "usage" message won't be gotten either, if a _notrun be called
after this helper return 1 .

        if [ -z "$device" ] || [ -z "$mountpoint" ]; then
                echo "Usage: _supports_xfs_scrub mountpoint device"
                return 1
        fi

If there's not _notrun after that, the message will be gotten I think.
So I think the "return 1" makes sense.

What do both of you think ?

Thanks,
Zorro

> 





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux